Skip to content

Commit 0adda64

Browse files
committed
Working build scripts
1 parent d5d7399 commit 0adda64

3 files changed

+32
-25
lines changed

webpack.config.electron.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ export default {
3333
}),
3434
],
3535

36-
target: 'electron-main',
36+
target: 'electron-renderer',
3737

3838
node: {
3939
__dirname: false,
4040
__filename: false,
4141
},
4242

4343
externals: [
44-
...baseConfig.externals,
4544
'keytar',
4645
'openpgp',
4746
'font-awesome',

webpack.config.node.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// for babel-plugin-webpack-loaders
2-
require('babel-register');
3-
const devConfigs = require('./webpack.config.development');
2+
require('babel-register')
3+
const devConfigs = require('./webpack.config.development')
44

55
module.exports = {
66
output: {
7-
libraryTarget: 'commonjs2'
7+
libraryTarget: 'commonjs2',
88
},
99
module: {
10-
loaders: devConfigs.module.loaders.slice(1) // remove babel-loader
11-
}
12-
};
10+
loaders: devConfigs.module.loaders,
11+
},
12+
}

webpack.config.production.js

+25-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
import webpack from 'webpack';
2-
import ExtractTextPlugin from 'extract-text-webpack-plugin';
3-
import baseConfig from './webpack.config.base';
1+
import webpack from 'webpack'
2+
import ExtractTextPlugin from 'extract-text-webpack-plugin'
3+
import baseConfig from './webpack.config.base'
44

55
const config = {
66
...baseConfig,
77

88
devtool: 'source-map',
99

10-
entry: './app/index',
10+
entry: [
11+
'babel-polyfill',
12+
'./app/index',
13+
],
1114

1215
output: {
1316
...baseConfig.output,
1417

15-
publicPath: '../dist/'
18+
publicPath: '../dist/',
1619
},
1720

1821
module: {
@@ -26,17 +29,17 @@ const config = {
2629
loader: ExtractTextPlugin.extract(
2730
'style-loader',
2831
'css-loader'
29-
)
32+
),
3033
},
3134

3235
{
3336
test: /^((?!\.global).)*\.css$/,
3437
loader: ExtractTextPlugin.extract(
3538
'style-loader',
3639
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
37-
)
38-
}
39-
]
40+
),
41+
},
42+
],
4043
},
4144

4245
plugins: [
@@ -45,19 +48,24 @@ const config = {
4548
new webpack.DefinePlugin({
4649
__DEV__: false,
4750
'process.env': {
48-
NODE_ENV: JSON.stringify('production')
49-
}
51+
NODE_ENV: JSON.stringify('production'),
52+
},
5053
}),
5154
new webpack.optimize.UglifyJsPlugin({
5255
compressor: {
5356
screw_ie8: true,
54-
warnings: false
55-
}
57+
warnings: false,
58+
},
5659
}),
57-
new ExtractTextPlugin('style.css', { allChunks: true })
60+
new ExtractTextPlugin('style.css', { allChunks: true }),
61+
],
62+
63+
externals: [
64+
'keytar',
65+
'openpgp',
5866
],
5967

60-
target: 'electron-renderer'
61-
};
68+
target: 'electron-renderer',
69+
}
6270

63-
export default config;
71+
export default config

0 commit comments

Comments
 (0)