-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
45 lines (43 loc) · 1.5 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
const path = require('path')
const webpack = require('webpack')
const ngtools = require('@ngtools/webpack')
module.exports = {
context: __dirname,
entry: {
'main': "main.ts",
'polyfills': "src/polyfills.ts",
},
output: {
path: path.resolve(__dirname, "dist"),
publicPath: "/assets/",
filename: '[name].js',
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
loaders: [
{ test: /\.ts$/, loader: '@ngtools/webpack' },
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.scss$/, use: ['raw-loader', 'sass-loader'] },
{ test: /\.css$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
{ test: /\.(png|svg)$/, loader: "file-loader", options: { name: 'images/[name].[ext]' } }
]
},
// externals: {
// '@angular/core': 'commonjs @angular/core',
// '@angular/compiler': 'commonjs @angular/compiler',
// '@angular/platform-browser': 'commonjs @angular/platform-browser',
// '@angular/platform-browser-dynamic': 'commonjs @angular/platform-browser-dynamic',
// '@angular/forms': 'commonjs @angular/forms',
// '@angular/common': 'commonjs @angular/common',
// 'mz': 'commonjs mz',
// 'path': 'commonjs path',
// 'rxjs': 'commonjs rxjs',
// 'zone.js': 'commonjs zone.js/dist/zone.js',
// },
plugins: [
new ngtools.AotPlugin({ tsConfigPath: path.join(__dirname, "tsconfig.json"), entryModule: path.join(__dirname, "src", "app.module#AppModule") }),
new webpack.optimize.ModuleConcatenationPlugin(),
],
}