This plugin was inspired by NamedModulesPlugin. When sparse array of modules generated by webpack is not good for some browsers, so then is good to generate names of modules.
In projects where is used about 400 modules or more their IDs was generated by path and filename like it was defined in source files that mean it has in production build over 60KB when you use NamedModulesPlugin for this case was made this plugin to reduce size.
- Maple 2011 (older browser based on Gecko, near to Firefox 2.5)
- IE 8 and below (webpack/webpack#2063)
npm i https://github.com/lkrocek/short-named-modules-webpack-plugin.git -D
in webpack.config.js
file:
var ShortNamedModulesPlugin = require('short-named-modules-webpack-plugin');
...
module.exports = {
...
plugins: [
new ShortNamedModulesPlugin()
],
};
That's it :-), happy coding.