Use UMD for web ouput

UMD output seems to be working well for the storage module; this change
adjusts the web-targeted build outputs of this module to use it as well.
Also, common output properties are now specified in the base config and
removed from each individual config.
This commit is contained in:
Christopher Willis-Ford 2017-11-27 20:00:03 -08:00
parent 12acdefb5a
commit 88dada5cb8

View file

@ -10,6 +10,10 @@ const base = {
port: process.env.PORT || 8073
},
devtool: 'cheap-module-source-map',
output: {
library: 'VirtualMachine',
filename: '[name].js'
},
module: {
rules: [{
test: /\.js$/,
@ -37,8 +41,8 @@ module.exports = [
'scratch-vm.min': './src/index.js'
},
output: {
path: path.resolve(__dirname, 'dist/web'),
filename: '[name].js'
libraryTarget: 'umd',
path: path.resolve('dist', 'web')
},
module: {
rules: base.module.rules.concat([
@ -56,10 +60,8 @@ module.exports = [
'scratch-vm': './src/index.js'
},
output: {
library: 'VirtualMachine',
libraryTarget: 'commonjs2',
path: path.resolve(__dirname, 'dist/node'),
filename: '[name].js'
path: path.resolve('dist', 'node')
},
plugins: base.plugins.concat([
new CopyWebpackPlugin([{
@ -87,8 +89,8 @@ module.exports = [
]
},
output: {
path: path.resolve(__dirname, 'playground'),
filename: '[name].js'
libraryTarget: 'umd',
path: path.resolve('playground')
},
module: {
rules: base.module.rules.concat([