-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
62 lines (58 loc) · 1.32 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// docs: http://webpack.github.io/docs/
var HappyPack = require('happypack');
const minimist = require('minimist');
var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const path = require('path');
const args = minimist(process.argv.slice(2));
let plugins = [];
plugins.push(new HappyPack({
id: 'ts',
threads: 2,
loaders: [
{
path: 'ts-loader',
query: { happyPackMode: true }
}
]
}));
plugins.push(new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true }));
module.exports = {
mode: 'development',
context: __dirname,
entry: {
'index': './src/index.ts',
},
output: {
path: path.join(__dirname, 'dist/js/'),
publicPath: 'dist/js/',
filename: '[name].js'
},
resolve: {
extensions: ['.ts', '.js']
},
optimization: {
minimize: false,
splitChunks: false
},
node: {
fs: 'empty'
},
module: {
rules: [
{
test: /\.ts$|\.js$/,
exclude: ['dist', 'libs', 'node_modules'],
loader: 'happypack/loader?id=ts'
}
]
},
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
// 'Access-Control-Allow-Origin': 'http://10.0.2.2:8181' // swap this in for testing exemplar site on IE VMs
},
disableHostCheck: true
},
plugins: plugins,
devtool: 'source-map'
};