forked from kozlice/angular2-webpack-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.test.js
58 lines (55 loc) · 1.79 KB
/
webpack.config.test.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
/**
* Config for test environment is pretty different from dev and prod, so we don't use common config as base.
*
* Karma watches the test entry points, so we don't need to define entry point here.
*/
module.exports = {
/**
* Inline source maps, generated by TypeScript compiler, will be used for code coverage.
*/
devtool: 'inline-source-map',
verbose: true,
resolve: {
extensions: ['', '.ts', '.js', '.scss', '.html'],
modulesDirectories: ['node_modules', 'src']
},
module: {
loaders: [
/**
* Enable inline source maps for code coverage report.
*
* See info about loaders in dev config.
*/
{
test: /\.ts$/,
loaders: [
'awesome-typescript-loader?' + JSON.stringify({
sourceMap: false,
inlineSourceMap: true
}),
'angular2-template-loader'
]
},
/**
* These loaders are used in other environments as well, see `webpack.config.common.js`.
*/
{test: /\.json$/, loader: 'json-loader'},
{test: /\.html$/, loader: 'raw-loader'},
{test: /\.scss$/, loaders: ['raw-loader', 'sass-loader']}
],
postLoaders: [
/**
* Instruments TS source files for subsequent code coverage.
* See https://github.com/deepsweet/istanbul-instrumenter-loader
*/
{
test: /\.ts$/,
loader: 'istanbul-instrumenter-loader',
exclude: [
'node_modules',
/\.(e2e|spec)\.ts$/
]
}
]
}
};