-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
75 lines (72 loc) · 1.97 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const HELP = require('./config/helpers');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const extractSass = new ExtractTextPlugin({
filename: "app.css"
});
const HtmlWebpackPlugin = require('html-webpack-plugin');
const DllBundlesPlugin = require('webpack-dll-bundles-plugin').DllBundlesPlugin;
module.exports = {
entry: HELP.ENTRY_FILE,
output: {
filename: HELP.OUTPUT_FILENAME,
path: HELP.DIST_FOLDER
},
devServer: {
contentBase: HELP.DIST_FOLDER,
port: HELP.PORT
},
module: {
rules: [
{
test: /\.scss$/,
use: extractSass.extract({
use: [
{ loader: "css-loader" },
{ loader: "sass-loader" }
],
fallback: "style-loader"
})
},
{
test: /\.js$/,
//exclude: /(node_modules|bower_components)/,
include: HELP.INCLUDE_FOR_BABEL,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
},
{
test: /\.html$/,
exclude: /(node_modules|bower_components)/,
loader: 'raw-loader'
}
],
},
resolve: {
extensions: [".js", "scss", "html"]
},
plugins: [
extractSass,
new HtmlWebpackPlugin({
title: 'demo',
template: HELP.INDEX_TEMPLATE
}),
new DllBundlesPlugin({
bundles: {
vendor: [
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/core',
'@angular/common',
'@angular/forms',
'@angular/http',
'@angular/router',
'rxjs'
]
},
dllDir: HELP.DLL_FOLDER,
})
],
devtool: 'inline-source-map'
};