forked from vsternbach/angularjs-typescript-webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.test.js
executable file
·75 lines (72 loc) · 1.62 KB
/
webpack.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const path = require('path');
const sourcePath = path.resolve(__dirname, 'src');
const plugins = [
new ForkTsCheckerWebpackPlugin({
tslint: true,
checkSyntacticErrors: true
})
];
module.exports = {
mode: 'development',
devtool: 'eval-source-map',
module: {
rules: [
{
test: /\.html$/,
loader: 'html-loader',
},
{
test: /\.css$/,
use: ['css-loader', 'resolve-url-loader']
},
{
test: /\.scss$/,
use: ['css-loader', 'resolve-url-loader', 'sass-loader']
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ng-annotate-loader',
options: {
ngAnnotate: 'ng-annotate-patched',
sourcemap: true,
},
},
{
loader: 'ts-loader',
options: {
configFile: sourcePath + '/tsconfig.spec.json',
// disable type checker - we will use it in fork plugin
transpileOnly: true,
}
}
]
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
loader: 'file-loader',
options: {
name: 'images/[name].[ext]'
}
},
{
test: /\.(eot|ttf|woff|woff2)$/,
loader: 'file-loader',
options: {
name: 'fonts/[name].[ext]'
}
}
],
},
resolve: {
extensions: ['.js', '.ts'],
modules: [
path.resolve(__dirname, 'node_modules'),
sourcePath
]
},
plugins,
};