Exports a JSON file that maps entry names to public paths of chunks for an entry grouped by chunk file extensions.
{
"site": {
"js": [
"/public/common.js",
"/public/site.js"
],
"css": [
"/public/common.css",
"/public/site.css"
]
},
"admin": {
"js": [
"/public/common.js",
"/public/admin.js"
],
"css": [
"/public/common.css",
"/public/admin.css"
]
}
}
This mapping can then be used to generate import assets in HTML by entry name not the asset names.
Install via npm:
npm install entrypoint-assets-webpack-plugin
Usage example:
const webpack = require('webpack')
const EntrypointAssetsPlugin = require('entrypoint-assets-webpack-plugin')
module.exports = {
entry: {
"site": "./site",
"admin": "./admin"
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: "common",
chunks: ["site", "admin"]
}),
new EntrypointAssetsPlugin()
]
};
Default:"entrypoints.json"
Exported entrypoints filename.
Default:
{
"js": /\.js$/,
"map": /\.map$/,
"css": /\.css$/
}
Groups assets by regexp.