This commit is contained in:
Rich Harris
2018-01-21 11:03:23 -05:00
parent 4590aa313c
commit 39b1fa89ce
27 changed files with 2392 additions and 401 deletions

44
src/webpack/index.js Normal file
View File

@@ -0,0 +1,44 @@
import { dest, dev, entry } from '../config.js';
export default {
dev,
client: {
entry: () => {
return {
main: [
entry.client,
// workaround for https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/456
'style-loader/lib/addStyles',
'css-loader/lib/css-base'
]
};
},
output: () => {
return {
path: `${dest}/client`,
filename: '[name].[hash].js',
chunkFilename: '[name].[id].[hash].js',
publicPath: '/client/'
};
}
},
server: {
entry: () => {
return {
main: entry.server
};
},
output: () => {
return {
path: `${dest}/server`,
filename: '[name].[hash].js',
chunkFilename: '[name].[id].[hash].js',
libraryTarget: 'commonjs2'
};
}
}
};