-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
40 lines (37 loc) · 950 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var AssetsPlugin = require('assets-webpack-plugin');
var assetsPluginOpts = {
path: path.join(__dirname, 'src', 'server'),
filename: 'assets.json',
prettyPrint: true
};
var providePluginOpts = {
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
};
module.exports = {
entry: './src/client/app.js',
output: {
path: path.join(__dirname, 'public', '[hash]'),
filename: '[name].js',
sourceMapFilename: '[file].map',
publicPath: '/[hash]/'
},
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new ExtractTextPlugin('[name].css'),
new AssetsPlugin(assetsPluginOpts),
new webpack.ProvidePlugin(providePluginOpts)
]
};