forked from ngParty/Angular1-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-test.config.js
56 lines (49 loc) · 1.38 KB
/
webpack-test.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
const webpack = require( 'webpack' );
const webpackConfig = require( './webpack.config' );
/**
* Source map for Karma from the help of karma-sourcemap-loader & karma-webpack
*
* Do not change, leave as is or it wont work.
* See: https://github.com/webpack/karma-webpack#source-maps
*/
const webpackDevtool = 'inline-source-map';
const webpackPostLoaders = [
/**
* Instruments JS files with Istanbul for subsequent code coverage reporting.
* Instrument only testing sources.
*
* See: https://github.com/deepsweet/istanbul-instrumenter-loader
*/
{
test: /\.(js|ts)$/,
loader: 'istanbul-instrumenter-loader',
include: webpackConfig.resolve.root,
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/,
// @TODO this is temporary, will remove when typescript-helpers will be extracted to separate package
/(polyfills|vendor)\.ts$/
]
}
];
const webpackNode = {
/**
* Include polyfills or mocks for various node stuff
* Description: Node configuration
*
* See: https://webpack.github.io/docs/configuration.html#node
*/
process: false
};
Object.assign( webpackConfig, {
entry: {},
output: {},
devtool: webpackDevtool,
watch: false,
plugins: [],
node: Object.assign( webpackConfig.node, webpackNode )
} );
Object.assign( webpackConfig.module, {
postLoaders: webpackPostLoaders
} );
module.exports = webpackConfig;