3.0.0 • Published 5 months ago

webpack-watched-glob-entries-plugin v3.0.0

Weekly downloads
1,746
License
MIT
Repository
github
Last release
5 months ago

Node.js CI CodeQL license downloads-week

Webpack-watched-glob-entries-plugin

Provides a way to glob for entry files in Webpack watch and non-watch modes.

Install

Install through yarn or npm =>

yarn add -D webpack-watched-glob-entries-plugin

or

npm install --save-dev webpack-watched-glob-entries-plugin

Usage

// Get the plugin
const WebpackWatchedGlobEntries = require('webpack-watched-glob-entries-plugin');
 
// In your Webpack config:
{
    ... // At your entry definition
    
    entry: WebpackWatchedGlobEntries.getEntries(
      [ 
        // Your path(s) 
        path.resolve(__dirname, 'entry/**/*.js'),
        path.resolve(__dirname, 'more/entries/**/*.js')
      ],
      {
          // Optional glob options that are passed to glob.sync()
          ignore: '**/*.test.js'
      }
    )
    
    ... // At the plugin definition
    
    plugins: [
        new WebpackWatchedGlobEntries(),
    ],
    
    ...
}

Why?

I wanted to use Webpack for my projects but was missing a way to add new entries without touching the config.

Example

If you have the following source structure:

- entries
    - main.js
    - Some
        - stuff.js
    - Other
        - things.js 

The entries will look like:

{
    "main":         "/abs/path/to/main.js",
    "Some/stuff":   "/abs/path/to/Some/stuff.js",
    "Other/things": "/abs/path/to/Other/things.js"
}

Now add [name] in your output.filename and the entry file directory structure will be reflected in the output directory.

3.0.0

5 months ago

2.2.6

1 year ago

2.2.5

2 years ago

2.2.3

2 years ago

2.2.4

2 years ago

2.2.1

3 years ago

2.2.2

3 years ago

2.2.0

3 years ago

2.1.10

3 years ago

2.1.9

3 years ago

2.1.8

3 years ago

2.1.7

4 years ago

2.1.6

4 years ago

2.1.5

5 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago