-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.common.config.js
More file actions
88 lines (77 loc) · 2.3 KB
/
Copy pathwebpack.common.config.js
File metadata and controls
88 lines (77 loc) · 2.3 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const webpack = require('webpack')
const autoprefixer = require('autoprefixer');
const path = require('path');
// plugins
const OccurenceOrderPlugin = webpack.optimize.OccurenceOrderPlugin;
const ProvidePlugin = webpack.ProvidePlugin;
module.exports = {
cache: true,
debug: true,
devtool: 'source-map',
entry: {
main: [
'./src/main'
],
vendor: [
'es6-shim',
'reflect-metadata',
'zone.js',
'@angular/common',
'@angular/core',
'@angular/http',
'@angular/platform-browser',
'@angular/router',
'rxjs'
]
},
output: {
filename: '[name].js',
path: path.resolve('./target'),
publicPath: undefined
},
resolve: {
extensions: ['', '.ts', '.js', '.min.js'],
modulesDirectories: ['node_modules', 'src/components', 'src/vendor'],
root: path.resolve('./src')
},
module: {
loaders: [
{test: /\.html$/, loader: 'html'},
{test: /\.scss$/, loaders: ['style', 'css', 'postcss', 'resolve-url', 'sass']},
{test: /\.(jpe?g|png|gif|svg|cur)(\?.*?)?$/i, loaders: [
'file?hash=sha512&digest=hex&name=[hash].[ext]',
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]},
{ test: /\.(ttf|eot|woff(2)?)(\?v=[0-9]\.[0-9](\.[0-9])?)?|(\?.*?)]$/, loader: 'file-loader' },
{ test: /\.json$/, loader: 'json' }
],
noParse: [
/@angular\/*\/bundles\/.+/
]
},
htmlLoader: {
minimize: true,
removeAttributeQuotes: false,
caseSensitive: true,
customAttrSurround: [ [/#/, /(?:)/], [/\*/, /(?:)/], [/\[?\(?/, /(?:)/] ],
customAttrAssign: [ /\)?]?=/ ]
},
postcss: function() {
return [autoprefixer({browsers: ['last 3 versions', 'Firefox ESR']})];
},
sassLoader: {
outputStyle: undefined,
precision: 10,
sourceComments: false
},
plugins: [
new OccurenceOrderPlugin(),
new ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
jquery: 'jquery',
"Tether": 'tether',
"window.Tether": "tether"
})
],
};