forked from mobxjs/mobx-react-todomvc
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.ts
35 lines (33 loc) · 872 Bytes
/
webpack.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import path = require('path');
import webpack = require('webpack');
const config: webpack.Configuration = {
devtool: 'eval',
entry: [
'webpack-hot-middleware/client?reload=true',
'./src/client'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV) },
__CLIENT__: JSON.stringify(true),
__SERVER__: JSON.stringify(false),
}),
],
resolve: {
extensions: ['', '.js', '.ts', '.tsx']
},
module: {
loaders: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: 'ts-loader' }
]
}
};
module.exports = config;