replace 'got' with 'nets' and fix the 'web+commonjs2' and 'node+commonjs2' targets in webpack.config.js

This commit is contained in:
Geng Shenghong 2017-09-08 15:08:26 +08:00
parent 58f45be54e
commit 6fc4832f97
5 changed files with 32 additions and 26 deletions

View file

@ -27,7 +27,7 @@ const base = {
};
module.exports = [
// Web-compatible
// Web + UMD
Object.assign({}, base, {
target: 'web',
entry: {
@ -36,11 +36,25 @@ module.exports = [
},
output: {
path: __dirname,
filename: 'dist/web/[name].js'
filename: 'dist/web_umd/[name].js'
}
}),
// Node-compatible
// Web + commonjs2
Object.assign({}, base, {
target: 'web',
entry: {
'scratch-storage': './src/index.js'
},
output: {
library: 'ScratchStorage',
libraryTarget: 'commonjs2',
path: __dirname,
filename: 'dist/web_commonjs2/[name].js'
}
}),
// Node + commonjs2
Object.assign({}, base, {
target: 'node',
entry: {
@ -50,7 +64,7 @@ module.exports = [
library: 'ScratchStorage',
libraryTarget: 'commonjs2',
path: __dirname,
filename: 'dist/node/[name].js'
filename: 'dist/node_commonjs2/[name].js'
}
})
];