mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 13:48: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 toHex = require('convert-css-color-name-to-hex');
|
||||||
const notify = require('./notify');
|
const notify = require('./notify');
|
||||||
|
|
||||||
|
app.commandLine.appendSwitch('js-flags', '--harmony');
|
||||||
|
|
||||||
// set up config
|
// set up config
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
config.init();
|
config.init();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
"babel-core": "6.11.4",
|
"babel-core": "6.11.4",
|
||||||
"babel-eslint": "6.1.2",
|
"babel-eslint": "6.1.2",
|
||||||
"babel-loader": "6.2.4",
|
"babel-loader": "6.2.4",
|
||||||
"babel-preset-es2015-native-modules": "6.9.2",
|
|
||||||
"babel-preset-react": "6.11.1",
|
"babel-preset-react": "6.11.1",
|
||||||
"electron-builder": "5.17.0",
|
"electron-builder": "5.17.0",
|
||||||
"electron-prebuilt": "1.3.1",
|
"electron-prebuilt": "1.3.1",
|
||||||
|
|
@ -76,7 +75,6 @@
|
||||||
},
|
},
|
||||||
"babel": {
|
"babel": {
|
||||||
"presets": [
|
"presets": [
|
||||||
"es2015-native-modules",
|
|
||||||
"react"
|
"react"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -101,7 +99,7 @@
|
||||||
"prepublish": "npm test",
|
"prepublish": "npm test",
|
||||||
"prepush": "npm test",
|
"prepush": "npm test",
|
||||||
"postinstall": "install-app-deps",
|
"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",
|
"dist": "npm run build && build",
|
||||||
"release": "npm run build && build --publish=onTagOrDraft"
|
"release": "npm run build && build --publish=onTagOrDraft"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,7 @@ module.exports = {
|
||||||
{
|
{
|
||||||
test: /\.(js|jsx)$/,
|
test: /\.(js|jsx)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loaders: [
|
loader: 'babel'
|
||||||
'babel-loader'
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.json/,
|
test: /\.json/,
|
||||||
|
|
@ -27,27 +25,11 @@ module.exports = {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
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({
|
new webpack.DefinePlugin({
|
||||||
'process.env': {
|
'process.env': {
|
||||||
'NODE_ENV': JSON.stringify(nodeEnv)
|
'NODE_ENV': JSON.stringify(nodeEnv)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
],
|
||||||
|
target: 'electron'
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue