-
Notifications
You must be signed in to change notification settings - Fork 36
/
webpack.config.js
60 lines (50 loc) · 1.07 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
'use strict'
const webpack = require('webpack')
const merge = require('webpack-merge')
const baseConfig = require('./webpack.config.base')
const port = 3000
module.exports = merge(baseConfig, {
cache: true,
entry: [
'babel-polyfill',
'./app/index',
],
debug: true,
target: 'electron-renderer',
devtool: '#inline-source-map',
output: {
publicPath: `http://localhost:${port}/dist`,
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel?cacheDirectory',
exclude: /node_modules/,
},
{
test: /\.global\.css$/,
loaders: [
'style-loader',
'css-loader?sourceMap',
],
},
{
test: /^((?!\.global).)*\.css$/,
loaders: [
'style-loader',
'css-loader?modules&sourceMap&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
'postcss-loader',
],
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
],
postcss: () => [require('postcss-cssnext')()],
})