-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
61 lines (55 loc) · 1.6 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
var path = require('path'),
ExtractTextPlugin = require('extract-text-webpack-plugin'),
config = require('./package').config,
webpackTargetElectronRenderer = require('webpack-target-electron-renderer');
config.resolve = {
root: path.resolve(config.root),
alias: {
config: path.resolve('./config' + (process.env.NODE_ENV == 'production' ? '' : '-dev') + '.js')
},
extensions: config.extensions
};
config.module = {
loaders: [
{
test: /(\.jsx$)|(\.js$)/,
exclude: /node_modules\/(?!(chirashi|bricks\.js)).+/,
loader: 'babel',
query: {
presets: ['es2015', 'stage-0']
}
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.(otf|eot|svg|ttf|woff)/,
loader: 'url?limit=10000'
},
{
test: /\.(jpg|png|gif)/,
loader: 'url?limit=10000'
},
{
test: /\.scss$/,
loader: (process.env.NODE_ENV == 'production' ? ExtractTextPlugin.extract('style', 'css!postcss!sass') : 'style!css!postcss!sass')
},
{
test: /\.(html|svg)$/,
loader: 'raw'
},
{
test: /\.(glsl|frag|vert)$/,
loader: 'shader'
}
]
};
config.postcss = [
require('autoprefixer')(config.autoprefixer)
];
config.plugins = [
new ExtractTextPlugin(config.cssFile)
];
config.target = webpackTargetElectronRenderer(config);
module.exports = config;