diff --git a/app/index.js b/app/index.js index 568cb844..4c7fb2c4 100644 --- a/app/index.js +++ b/app/index.js @@ -8,6 +8,8 @@ const AutoUpdater = require('./auto-updater'); const toHex = require('convert-css-color-name-to-hex'); const notify = require('./notify'); +app.commandLine.appendSwitch('js-flags', '--harmony'); + // set up config const config = require('./config'); config.init(); diff --git a/package.json b/package.json index 73b5be4f..046db9a8 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "babel-core": "6.11.4", "babel-eslint": "6.1.2", "babel-loader": "6.2.4", - "babel-preset-es2015-native-modules": "6.9.2", "babel-preset-react": "6.11.1", "electron-builder": "5.17.0", "electron-prebuilt": "1.3.1", @@ -76,7 +75,6 @@ }, "babel": { "presets": [ - "es2015-native-modules", "react" ] }, @@ -101,7 +99,7 @@ "prepublish": "npm test", "prepush": "npm test", "postinstall": "install-app-deps", - "pack": "npm run build && build --dir", + "pack": "npm run build && build --dir && babel --no-comments --compact --minified --out-file app/dist/bundle.js app/dist/bundle.js", "dist": "npm run build && build", "release": "npm run build && build --publish=onTagOrDraft" } diff --git a/webpack.config.js b/webpack.config.js index 80dc88c5..9750da8b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,9 +16,7 @@ module.exports = { { test: /\.(js|jsx)$/, exclude: /node_modules/, - loaders: [ - 'babel-loader' - ] + loader: 'babel' }, { test: /\.json/, @@ -27,27 +25,11 @@ module.exports = { ] }, plugins: [ - new webpack.ExternalsPlugin('commonjs', ['electron']), - new webpack.optimize.UglifyJsPlugin({ - mangle: { - keep_fnames: true - }, - compress: { - warnings: false - }, - output: { - comments: false - }, - sourceMap: false - }), - new webpack.LoaderOptionsPlugin({ - minimize: true, - debug: false - }), new webpack.DefinePlugin({ 'process.env': { 'NODE_ENV': JSON.stringify(nodeEnv) } }) - ] + ], + target: 'electron' };