@lewebsimple/nuxt-barrel
v0.0.3
Published
Nuxt module for automatic barrel files
Downloads
3
Readme
Nuxt Barrel
Nuxt module for automatic barrel files.
Features
- ⛰ Named exports from a certain glob pattern become properties of an auto-imported object
- 🔥 HMR of files in the glob pattern
Quick Setup
Install the module to your Nuxt application with one command:
npx nuxi module add @lewebsimple/nuxt-barrel
Configure the auto-imported objects and their respective glob patterns like so:
export default defineNuxtConfig({
barrel: {
myBarrel: ["server/barrel/*.ts"],
},
})
That's it! You can now use myBarrel
in the server space of your Nuxt app ✨
Contribution
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release