-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (42 loc) · 1.4 KB
/
webpack.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
const path = require("path");
const webpack = require("webpack");
const WebpackNotifierPlugin = require("webpack-notifier");
module.exports = {
mode: 'development',
entry: './main.ts',
output: {
path: path.resolve(__dirname, "dist"),
filename: 'bundle.js',
},
resolve: {
extensions: ['.ts','.js']
},
module: {
rules: [
// all files with a `.ts` extension will be handled by `ts-loader`
{ test: /\.ts$/, loader: 'ts-loader' },
// Ignore warnings about System.import in Angular
{ test: /[\/\\]@angular[\/\\].+\.js$/, parser: { system: true } },
// Plugin to change templateUrl to template with require statement
{ test: /\.ts$/, loader: 'angular2-template-loader' },
// Allow loading html with require statements for the above to work
{ test: /\.(html|css)$/, loader: 'raw-loader' }
]
},
plugins: [
// To quench weird webpack warning, see https://github.com/angular/angular/issues/11580#issuecomment-327338189
new webpack.ContextReplacementPlugin(
/(.+)?angular(\\|\/)core(.+)?/,
path.resolve(__dirname, 'src'), // location of your src
{} // a map of your routes
),
// Show OS notification on every rebuild
new WebpackNotifierPlugin({alwaysNotify: true}),
],
devServer: {
contentBase: path.resolve(__dirname, "dist"),
watchContentBase: true,
port: 9000,
},
devtool: 'inline-source-map'
};