UNPKG

1.37 kBPlain TextView Raw
1import * as webpack from 'webpack';
2import * as path from 'path';
3
4export default {
5 resolve: {
6 extensions: [ '.ts', '.js', '.json' ]
7 },
8 module: {
9 rules: [
10 {
11 test: /\.ts$/,
12 use: [
13 {
14 loader: 'awesome-typescript-loader',
15 options: {
16 configFileName: 'tsconfig.json'
17 }
18 },
19 {
20 loader: 'angular2-template-loader'
21 }
22 ],
23 exclude: [
24 /\.e2e\.ts$/,
25 /node_modules/
26 ]
27 },
28
29 {
30 test: /.ts$/,
31 exclude: /(node_modules|\.spec\.ts|\.e2e\.ts$)/,
32 loader: 'istanbul-instrumenter-loader',
33 enforce: 'post'
34 },
35
36 {
37 test: /\.json$/,
38 use: 'json-loader'
39 },
40
41 {
42 test: /\.css$/,
43 use: ['to-string-loader', 'css-loader']
44 },
45
46 {
47 test: /\.scss$/,
48 use: ['to-string-loader', 'css-loader', 'sass-loader']
49 },
50
51 {
52 test: /\.html$/,
53 use: 'raw-loader'
54 }
55 ]
56 },
57 plugins: [
58 new webpack.SourceMapDevToolPlugin({
59 filename: null,
60 test: /\.(ts|js)($|\?)/i
61 }),
62
63 new webpack.ContextReplacementPlugin(
64 /angular(\\|\/)core(\\|\/)@angular/,
65 path.join(__dirname, 'src')
66 ),
67
68 new webpack.NoEmitOnErrorsPlugin()
69 ]
70} as webpack.Configuration;