-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpackBaseConfig.js
49 lines (48 loc) · 1 KB
/
webpackBaseConfig.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
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
module: {
loaders: [{
test: /\.json$/,
loader: 'json-loader'
}, {
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
compact: false
}
}, {
test: /\.less$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!less-loader')
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
}, {
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
}, {
test: /\.(png|jpg|gif)$/,
loader: 'url-loader?limit=8192'
}, {
test: /\.(ttf|eot|svg)$/,
loader: 'url-loader?limit=100000'
}]
},
externals: [
(function () {
var IGNORES = [
'electron'
];
return function (context, request, callback) {
if (IGNORES.indexOf(request) >= 0) {
return callback(null, `require('${request}')`);
}
return callback();
};
})()
],
resolve: {
root: path.resolve('./src')
}
};