mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Use babel for minification (#471)
This commit is contained in:
parent
2dec8a0da2
commit
d05d82cb32
3 changed files with 6 additions and 24 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue