forked from trekhleb/angular-library-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-test.config.ts
executable file
·70 lines (62 loc) · 1.34 KB
/
webpack-test.config.ts
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
63
64
65
66
67
68
69
70
import * as webpack from 'webpack';
import * as path from 'path';
export default {
resolve: {
extensions: [ '.ts', '.js', '.json' ]
},
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: 'awesome-typescript-loader',
options: {
configFileName: 'tsconfig.json'
}
},
{
loader: 'angular2-template-loader'
}
],
exclude: [
/\.e2e\.ts$/,
/node_modules/
]
},
{
test: /.ts$/,
exclude: /(node_modules|\.spec\.ts|\.e2e\.ts$)/,
loader: 'istanbul-instrumenter-loader',
enforce: 'post'
},
{
test: /\.json$/,
use: 'json-loader'
},
{
test: /\.css$/,
use: ['to-string-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['to-string-loader', 'css-loader', 'sass-loader']
},
{
test: /\.html$/,
use: 'raw-loader'
}
]
},
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: null,
test: /\.(ts|js)($|\?)/i
}),
new webpack.ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)@angular/,
path.join(__dirname, 'src')
),
new webpack.NoEmitOnErrorsPlugin()
]
} as webpack.Configuration;