forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
45 lines (41 loc) · 1.21 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
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
const ngToolsWebpack = require('@ngtools/webpack');
const path = require('path');
const flags = require('./webpack.flags.json');
const preprocessLoader = 'preprocess-loader' + (flags.DEBUG ? '?+DEBUG' : '');
module.exports = {
resolve: {
extensions: ['.ts', '.js']
},
entry: './src/app/main.jit.ts',
output: {
path: path.resolve('./dist'),
publicPath: 'dist/',
filename: 'app.main.js'
},
plugins: [
new ngToolsWebpack.AngularCompilerPlugin(require('./aotplugin.config.json'))
],
module: {
rules: [
{ test: /\.scss$/, loaders: ['raw-loader', 'sass-loader', preprocessLoader] },
{ test: /\.css$/, loader: 'raw-loader' },
{ test: /\.html$/, loaders: ['raw-loader', preprocessLoader] },
// Use preprocess to remove DEBUG only code.
// @ngtools/webpack must be the first (right most) loader.
{ test: /\.ts$/, use: [
{ loader: preprocessLoader },
{ loader: '@ngtools/webpack' }
] }
]
},
devServer: {
historyApiFallback: true
}
};