Merge pull request from cwillisf/fix-webpack-dev-server

Fix webpack dev server
This commit is contained in:
Chris Willis-Ford 2017-01-13 13:31:45 -08:00 committed by GitHub
commit a4b863e464
2 changed files with 19 additions and 7 deletions

1
.gitignore vendored
View file

@ -15,3 +15,4 @@ npm-*
# Build
/dist
/playground/scratch-render.js
/playground/scratch-render.js.map

View file

@ -13,6 +13,7 @@ const base = {
colors: true
}
},
devtool: 'source-map',
module: {
loaders: [
{
@ -47,20 +48,30 @@ const base = {
};
module.exports = [
// Playground
Object.assign({}, base, {
target: 'web',
entry: {
'scratch-render': './src/index-web.js'
},
output: {
path: path.resolve(__dirname, 'playground'),
filename: '[name].js'
}
}),
// Web-compatible
Object.assign({}, base, {
target: 'web',
entry: {
'dist/web/scratch-render': './src/index-web.js',
'dist/web/scratch-render.min': './src/index-web.js',
'playground/scratch-render': './src/index-web.js'
'scratch-render': './src/index-web.js',
'scratch-render.min': './src/index-web.js'
},
output: {
path: __dirname,
path: path.resolve(__dirname, 'dist/web'),
filename: '[name].js'
}
}),
// Webpack-compatible
// Node-compatible
Object.assign({}, base, {
target: 'node',
entry: {
@ -69,8 +80,8 @@ module.exports = [
output: {
library: 'ScratchRender',
libraryTarget: 'commonjs2',
path: __dirname,
filename: 'dist/node/[name].js'
path: path.resolve(__dirname, 'dist/node'),
filename: '[name].js'
}
})
];