@lewebsimple/nuxt-barrel
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Nuxt Barrel

npm version npm downloads License Nuxt

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

Local development
# 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

Readme

Keywords

none

Package Sidebar

Install

npm i @lewebsimple/nuxt-barrel

Weekly Downloads

5

Version

0.0.4

License

MIT

Unpacked Size

8.15 kB

Total Files

10

Last publish

Collaborators

  • pascalmartineau