-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
48 lines (39 loc) · 1013 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const webpack = require('webpack');
const path = require('path');
module.exports = (function(options) {
if (!options) options = {isTest: false};
var tsconfig = options.isTest ? "tsconfig.test.json" : "tsconfig.json";
return {
entry: {
main: path.join(__dirname, "src/index.ts")
},
output: {
path: path.join(__dirname, "dist"),
filename: "bundle.js"
},
devtool: 'inline-source-map',
module: {
rules: [
{ test: /\.ts$/, loader: "ts-loader?configFileName=" + tsconfig },
{
test: /^(.(?!\.test))*\.ts$/,
loader: "istanbul-instrumenter-loader",
query: {
embedSource: true
},
enforce: "post"
}
]
},
plugins: [
// new webpack.optimize.UglifyJsPlugin()
new webpack.SourceMapDevToolPlugin({ test: /\.ts$/i })
],
resolve: {
extensions: ['.ts', '.js', '.json'],
alias: {
// sinon: 'sinon/pkg/sinon'
}
}
}
});