convert to typescript

This commit is contained in:
Rich Harris
2018-01-21 16:28:02 -05:00
parent fd0dd4fe58
commit 8bad37205d
18 changed files with 177 additions and 119 deletions

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

@@ -0,0 +1,44 @@
import { dest, dev, entry } from '../config';
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'
};
}
}
};