mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(webpack) exclude object.assign, promise polyfill from dev build
This commit is contained in:
parent
354acbbdf6
commit
70224401c5
1 changed files with 17 additions and 0 deletions
|
|
@ -51,6 +51,9 @@ module.exports = {
|
|||
libraryTarget: 'umd'
|
||||
},
|
||||
plugins,
|
||||
externals: [
|
||||
externals
|
||||
],
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.js$/,
|
||||
|
|
@ -64,3 +67,17 @@ module.exports = {
|
|||
}
|
||||
};
|
||||
|
||||
function externals(context, request, fn) {
|
||||
if (!isDev)
|
||||
return fn();
|
||||
|
||||
const list = [
|
||||
'es6-promise',
|
||||
'object.assign',
|
||||
];
|
||||
|
||||
if (list.includes(request))
|
||||
return fn(null, request);
|
||||
|
||||
fn();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue