Skip to content

Instantly share code, notes, and snippets.

@Fl0pZz Fl0pZz/.babelrc Secret
Created Nov 17, 2017

Embed
What would you like to do?
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-runtime"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["istanbul"]
}
}
}
ERROR in static/js/5.93ab66d4a749cd072641.js from UglifyJs
Unexpected token: name (resolvePromise) [./node_modules/vue-charts/src/utils/makeDeferred.js:6,0][static/js/5.93ab66d4a749cd072641.js:20667,6]
ERROR in static/js/6.607ca16377a1e18dc831.js from UglifyJs
Unexpected token: name (resolvePromise) [./node_modules/vue-charts/src/utils/makeDeferred.js:6,0][static/js/6.607ca16377a1e18dc831.js:20638,6]
/*
This lets us resolve the promise outside the
promise function itself.
*/
export function makeDeferred () {
let resolvePromise = null
let rejectPromise = null
let promise = new Promise((resolve, reject) => {
resolvePromise = resolve
rejectPromise = reject
})
return {
promise: promise,
resolve: resolvePromise,
reject: rejectPromise
}
}
export default makeDeferred
// ...
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true,
uglifyOptions: {
ie8: false,
ecma: 7
}
})
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.