Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
multiple-bundles-webpack-plugin
Advanced tools
Extracts multiple components into separate bundles
This plugin prevents Webpack 4 from creating an separate output file from multiple, unrelated components.
Inspired by Webpack-flat-bundle.
:warning: To make independent css files, use Mini-Extract-Css-Plugin.
npm install --save-dev multiple-bundles-webpack-plugin
const { MultipleBundlesPlugin, globEntries } = require('multiple-bundles-webpack-plugin');
const entries = {
...globEntries(['./src/js/*/*.js']),
...globEntries(['./src/sass/*/*.scss'], { sass: true }),
};
sass
key as a second argument is needed to replace bundles paths fromsass/scss
tocss
It will create an object something like that:
{ 'js/components/helloWorld': './src/js/components/helloWorld.js',
'js/libs/picturefill': './src/js/libs/picturefill.js',
'css/core/_variables': './src/sass/core/_variables.scss',
'css/core/main': './src/sass/core/main.scss',
'css/utils/author': './src/sass/utils/author.scss' }
Then add entries
object to entry
property in webpack's object:
{
entry: entries
}
How it works?
By default this search tree and construct nested output tree, matching pattern provided.
{
plugins: [
new MultipleBundlesPlugin({
test: /\.js$/,
entries: globEntries(['./sass/*.scss']))
}
]
}
Property | Description |
---|---|
test | Match resources to being checked by plugin |
entries | Pass globEntries object to match source of files. |
If you're using Mini-Extract-Css-Plugin it's important to set test
property to /\.js$\
to matching only js files,
Otherwise plugin will prevent css files from emitting.
This plugin supports CSS and JS SourceMaps.
Recommended devtool flags:
See reference to get more: https://webpack.js.org/configuration/devtool/
Eval sourcemaps e.g. eval-source-map
do not work properly with Mini-Extract-Css-Plugin.
This issue is not related with this plugin.
Feel free to make a pull request with new features or hotfixes.
FAQs
Extracts multiple components into separate bundles
We found that multiple-bundles-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.