-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathcustomized.js
27 lines (24 loc) · 993 Bytes
/
customized.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const WebpackAssetsManifest = require('webpack-assets-manifest');
const manifest = new WebpackAssetsManifest({
output: 'customized-manifest.json',
// This will allow you to customize each individual entry in the manifest.
customize(entry, original, manifest, asset) {
if ( manifest.isMerging ) {
// Do something
}
// You can prevent adding items to the manifest by returning false.
if ( entry.key.toLowerCase().endsWith('.map') ) {
return false;
}
// You can directly modify key/value on the `entry` argument
// or you can return a new object that has key and/or value properties.
// If either the key or value is missing, the defaults will be used.
//
// The key should be a string and the value can be anything that can be JSON stringified.
// If something else (or nothing) is returned, the manifest will add the entry normally.
return {
key: `src/${entry.key}`,
value: `dist/${entry.value}`,
};
},
});