mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-07-25 13:38:50 -04:00
Webpack config cleanup, fix dev server
This change tweaks the expression of paths in the Webpack config to make `webpack-dev-server` work again. This opened the door for some minor cleanup of `path` & `filename` in the `output` configuration entries. Thanks to @rschamp for help resolving the `webpack-dev-server` problems.
This commit is contained in:
parent
c2ca8d2a84
commit
f5af954acb
1 changed files with 17 additions and 7 deletions
|
@ -48,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: {
|
||||
|
@ -70,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'
|
||||
}
|
||||
})
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue