-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
79 lines (73 loc) · 3.05 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
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
const NODE_ENV = process.env.NODE_ENV || 'development';
module.exports = {
devtool: NODE_ENV === 'development' ? '#cheap-module-source-map' : null,
entry: {},
resolve: {
modulesDirectories: ['node_modules', __dirname + '/vendor'],
extensions: ['', '.js']
},
resolveLoader: {
modulesDirectories: ['node_modules'],
moduleTemplate: ['*-loader', '*'],
extensions: ['', '.js']
},
module: {
noParse: [
/angular\/angular.js/,
/kendo\/js\/kendo.all.min.js/
],
loaders: [
{ test: /\.js$/, exclude: [/app\/lib/, /vendor/, /node_modules/], loader: 'ng-annotate!babel' },
{ test: /\.html$/, loader: 'html' },
{ test: /\.styl$/, loader: 'style!css!stylus' },
{ test: /\.css$/, loader: 'style!file!css' },
// inline base64 URLs for <=8k images, direct URLs for the rest
{ test: /\.(png|jpg|gif)$/, loader: 'url-loader?limit=8192&name=[path][name].[ext]'},
// helps to load bootstrap's css.
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&name=[path][name].[ext]&minetype=application/font-woff' },
{ test: /\.woff(\?[\w\d]+)?$/,
loader: 'url?limit=10000&name=[path][name].[ext]&minetype=application/font-woff' },
{ test: /\.woff2$/,
loader: 'url?limit=10000&name=[path][name].[ext]&minetype=application/font-woff' },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&name=[path][name].[ext]&minetype=application/octet-stream' },
{ test: /\.ttf(\?v=\d+\.\d+)?$/,
loader: 'url?limit=10000&name=[path][name].[ext]&minetype=application/octet-stream'},
{ test: /\.ttf(\?[\w\d]+)?$/,
loader: 'url?limit=10000&name=[path][name].[ext]&minetype=application/octet-stream' },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file?name=[path][name].[ext]' },
{ test: /\.eot(\?[\w\d]+)?$/,
loader: 'file?name=[path][name].[ext]' },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&name=[path][name].[ext]&minetype=image/svg+xml' },
{ test: /\.svg(\?[\w\d]+)?$/,
loader: 'url?limit=10000&name=[path][name].[ext]&minetype=image/svg+xml' }
]
},
plugins: [
// Injects bundles in your index.html instead of wiring all manually.
// It also adds hash to all injected assets so we don't have problems
// with cache purging during deployment.
new HtmlWebpackPlugin({
template: 'client/index.html',
inject: 'body',
hash: true
}),
// Automatically move all modules defined outside of application directory to vendor bundle.
// If you are using more complicated project structure, consider to specify common chunks manually.
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
return module.resource && module.resource.indexOf(path.resolve(__dirname, 'client')) === -1;
}
})
],
externals: {
$: "jQuery"
}
};