-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
63 lines (60 loc) · 1.77 KB
/
webpack.config.js
File metadata and controls
63 lines (60 loc) · 1.77 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
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
var webpack = require('webpack');
var path = require('path');
var HtmlwebpackPlugin = require('html-webpack-plugin');
var config = {
entry: ['babel-polyfill', './src/bootstrap.ts'],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
"shared": path.resolve(__dirname, 'src/app/shared')
}
},
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre",
exclude: [
path.join(__dirname, 'node_modules', '@angular/compiler'),
path.join(__dirname, 'node_modules', 'rxjs'),
path.join(__dirname, 'node_modules', 'jsoneditor')
]
},
{
test: /\.ts$/,
use: ["babel-loader", "ts-loader", "angular2-template-loader", "angular-router-loader"]
},
{
test: /\.(html|css)$/,
use: ['raw-loader'],
exclude: [path.resolve(__dirname, 'src/index.html')]
}]
},
plugins: [
new HtmlwebpackPlugin({
template: path.resolve(__dirname, 'src/index.html'),
inject: 'body'
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.ContextReplacementPlugin(
/angular(\\|\/)core(\\|\/)@angular/,
path.resolve(__dirname, 'src'),
{}
),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
})
],
devtool: 'source-map'
};
module.exports = config;