-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
31 lines (30 loc) · 936 Bytes
/
webpack.config.js
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
var path = require('path');
var webpack = require('webpack');
module.exports = {
mode: 'development',
devtool: 'source-map', // 'eval'
entry: [
'webpack-hot-middleware/client?reload=true',
'./src/index.tsx' // './src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json']
},
module: {
rules: [
{ test: /\.tsx?$/, include: path.join(__dirname, 'src'), exclude: /node_modules/, loader: 'awesome-typescript-loader' },
{ test: /\.jsx?$/, include: path.join(__dirname, 'src'), exclude: /node_modules/, loader: 'babel-loader' },
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' },
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' }
]
}
};