forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
38 lines (35 loc) · 1.03 KB
/
webpack.config.js
File metadata and controls
38 lines (35 loc) · 1.03 KB
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
const ngToolsWebpack = require('@ngtools/webpack');
const path = require('path');
const workspaceRoot = path.resolve(__dirname, './');
const projectRoot = path.resolve(__dirname, './');
module.exports = {
mode: 'development',
resolve: {
extensions: ['.ts', '.js']
},
entry: {
main: path.resolve(projectRoot, './src/main.ts'),
polyfills: path.resolve(projectRoot, './src/polyfills.ts')
},
output: {
path: path.resolve(workspaceRoot, './dist'),
filename: `[name].js`,
},
plugins: [
new ngToolsWebpack.AngularCompilerPlugin({
tsConfigPath: path.resolve(projectRoot, './src/tsconfig.app.json')
})
],
module: {
rules: [
{ test: /\.scss$/, loaders: ['raw-loader', 'sass-loader'] },
{ test: /\.css$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'raw-loader' },
// require.resolve is required only because of the monorepo structure here.
{ test: /\.ts$/, loader: require.resolve('@ngtools/webpack') }
]
},
devServer: {
historyApiFallback: true
}
};