Unexpected token: punc ())
[issue link]nuxt : 1.0.0-rc11
when I use vue-notifications, and this plugin needs another plugin mini-toastr.
import Vue from 'vue'
import VueNotifications from 'vue-notifications'
import miniToastr from 'mini-toastr'
miniToastr.init()
function toast({ title, message, type, timeout, cb }) {
return miniToastr[type](message, title, timeout, cb)
}
const options = {
success: toast,
error: toast,
info: toast,
warn: toast
}
Vue.use(VueNotifications, options)
after run ‘npm run build’,
ERROR in app.d9d8e7276f8cb0e2caa3.js from UglifyJs
Unexpected token: punc ()) [./node_modules/mini-toastr/mini-toastr.js:12,0][app.d9d8e7276f8cb0e2caa3.js:936,14]
I think it’s the mini-toastr used some ES6 syntax which needs babel.
How can I add mini-toastr into babel-loader config?