-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathwebpack.config.js
95 lines (84 loc) · 2.01 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
'use strict';
/**
* Module dependencies
*/
var path = require('path'),
webpack = require('webpack'),
HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
cache: true,
entry: {
'index': './app/index'
},
output: {
path : path.join(__dirname, 'www'),
filename : '[name].js',
chunkFilename : '[chunkhash].js'
},
module: {
loaders: [{
test : /\.css$/,
loader : 'style!css'
}, {
test : /\.html$/,
loader : 'html'
}, {
test : /\.json$/,
loader : 'json'
}, {
test : /\.scss$/,
loader : 'style!css!sass?outputStyle=expanded'
}, {
test : /\.woff/,
loader : 'url?prefix=font/&limit=10000&mimetype=application/font-woff'
}, {
test : /\.ttf/,
loader : 'file?prefix=font/'
}, {
test : /\.eot/,
loader : 'file?prefix=font/'
}, {
test : /\.svg/,
loader : 'file?prefix=font/'
}, {
test : /[\/]angular\.js$/,
loader : 'exports?angular'
}, {
test : /[\/]ionic\.js$/,
loader : 'exports?ionic'
}]
},
resolve: {
root: [
path.join(__dirname, 'app'),
path.join(__dirname, 'bower_components'),
path.join(__dirname, 'node_modules'),
],
moduleDirectories: [
'bower_components',
'node_modules',
],
alias: {
}
},
plugins: [
new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(
'bower.json', ['main'])
),
new webpack.DefinePlugin({
'process.env': {
// This has effect on the react lib size
'NODE_ENV': JSON.stringify('production')
}
}),
new HtmlWebpackPlugin({
pkg : require('./package.json'),
template : 'app/entry-template.html',
})
// new webpack.optimize.DedupePlugin(),
// new webpack.optimize.UglifyJsPlugin()
// new webpack.BannerPlugin(banner, options),
// new webpack.optimize.DedupePlugin()
]
};