You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @property {boolean} [productionOnly=true] If true, only applies changes and emits files in Webpack mode `production`.
29
29
* @property {string} [debugFolder=null] Directory where debug info files get written to.
30
30
* @property {boolean} [json5=false] If true, package output will be written with `json5.stringify` instead of `JSON.stringify`.
31
+
* @property {boolean} [autoExclude=false] If `true`, unneeded fields will be guessed and automatically excluded from output package.
32
+
* @property {string[]} [includeFields=[]] Field names that should forcefully be forwarded from `options.pkg` to generated pkg. For example, use `includeFields: ["babel"]` to include your Babel config in your output package.
33
+
* @property {string[]} [excludeFields=[]] Fields names that are never written to generated pkg.
31
34
*/
32
35
33
36
/**
@@ -50,7 +53,10 @@ export default class {
50
53
unicodeCopyright: true,
51
54
productionOnly: true,
52
55
debugFolder: null,
56
+
incudeFields: [],
57
+
excludeFields: [],
53
58
json5: false,
59
+
autoExclude: false,
54
60
...options,
55
61
}
56
62
if(this.options.format===true){
@@ -94,8 +100,9 @@ export default class {
94
100
if(this.options.autoTypes){
95
101
publishimoConfig.types=mainPath
96
102
}
97
-
if(compilation.options.target!=="node"){// Don't include dependencies in package.json if export target is not a Node module
103
+
if(this.options.autoExclude&&compilation.options.target!=="node"){// Don't include dependencies in package.json if export target is not a Node module
0 commit comments