Socket
Socket
Sign inDemoInstall

webpack-watched-glob-entries-plugin

Package Overview
Dependencies
32
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webpack-watched-glob-entries-plugin

Webpack plugin to glob directories for entry files and also watch them for changes


Version published
Maintainers
1
Install size
3.20 MB
Created

Readme

Source

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.

FAQs

Last updated on 23 Dec 2023

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc