Newer
Older
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 BundleTracker = require('webpack-bundle-tracker');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var glob = require("glob");
var path_bundles = __dirname + '/static/bundles/';
module.exports = {
context: __dirname,
entry: {
main: glob.sync("./scipost/static/scipost/assets/css/*.css")
},
output: {
path: path_bundles,
publicPath: '/static/bundles/',
filename: "js/[name]-[hash].js",
},
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
},
// Optionally extract less files (yeay!)
{
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
}
]
},
plugins: [
new BundleTracker({filename: './webpack-stats.json'}),
new ExtractTextPlugin('css/[name]-[hash].css'),
new CleanWebpackPlugin(['css', 'js'], {
root: path_bundles,
verbose: true,
dry: false,
exclude: []
})
]
}