forked from unclecheese/silverstripe-kickassets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
50 lines (47 loc) · 1.28 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
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var webpack = require('webpack');
var PROD = JSON.parse(process.env.PROD || "0");
module.exports = {
entry: './javascript/src/index.js',
output: {
path: './javascript/build', // This is where images AND js will go
publicPath: '', // This is used to generate URLs to e.g. images
filename: PROD ? 'bundle.min.js' : 'bundle.js'
},
module: {
loaders: [,
{
test: /\.js$/,
loader: 'babel-loader?stage=0',
exclude: /(node_modules|bower_components)/
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
},
{
test: /\.(otf|eot|svg|ttf|woff|woff2)$/,
loader: 'url-loader?limit=8192'
},
{
test: /\.png$/,
loader: "url-loader?limit=100000&mimetype=image/png"
},
{
test: /\.jpg$/,
loader: "file-loader"
}
],
noParse: [/cortex\.js$/, /bluebird\.js$/]
},
resolve: {
modulesDirectories: ["node_modules", "bower_components"]
},
plugins: [
new ExtractTextPlugin("[name].css")
]
};