Socket
Book a DemoInstallSign in
Socket

@crbroughton/nuxt-ignore-folders

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crbroughton/nuxt-ignore-folders

Ignore folders from file-based router

0.0.1
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

Nuxt Ignore Folders

A simple Nuxt module that allows you to specify folders to ignore from the file-based routing system. By default, Nuxt's pages router includes all files in the pages directory, but sometimes you may want to keep other folders (like components, utils, etc.) in your pages directory without them becoming part of your routes.

Installation

npm install @crbroughton/nuxt-ignore-folders

Usage

Add the module to your nuxt.config.ts:

export default defineNuxtConfig({
  modules: [
    '@crbroughton/nuxt-ignore-folders'
  ],
  
  // Module options
  ignoreFolders: {
    // Specify folders to ignore (replaces defaults)
    folders: ['composables']
  }
})

Options

OptionTypeDefaultDescription
foldersstring[]['assets', 'components', 'composables', 'layouts', 'middleware', 'plugins', 'public', 'server', 'shared', 'utils']Array of folder names to ignore from file-based routing. If you specify this option, it will replace the default list.

How it works

This module hooks into Nuxt's pages:extend hook to filter out pages that match your ignored folder patterns. Any page with a file path containing /<folder>/ will be excluded from routing.

For example, if you set folders: ['components'], the following paths would be excluded:

  • /components/Button.vue
  • /admin/components/Sidebar.vue
  • /any/path/with/components/inside.vue

But these would still be included:

  • /component-demos/index.vue (not in a 'components' folder)
  • /about/components-overview.vue (not in a 'components' folder)

License

MIT

FAQs

Package last updated on 03 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.