vuex-orm / plugin-change-flags

Vuex ORM plugin for adding IsDirty / IsNew flags to model entities.
MIT License
24 stars 10 forks source link

You may need an appropriate loader to handle this file type. #2

Open wkasem opened 5 years ago

wkasem commented 5 years ago

./node_modules/@vuex-orm/plugin-change-flags/dist/index.js Module parse failed: Unexpected token (59:30) You may need an appropriate loader to handle this file type. | install(e, t) { | const n = { | ...r, | ...t | },

tvillaren commented 5 years ago

Hello @wkasem,

How do you load the plugin and Vue / Vuex / VuexORM currently?

wkasem commented 5 years ago

using laravel mix and with this babelrc conf

{
  "presets": ["es2015", "stage-0"],
  "plugins": [
    "transform-class-properties",
    "transform-object-rest-spread",
    "transform-async-to-generator",
    "syntax-dynamic-import"
  ]
}
tvillaren commented 5 years ago

From what I read on the Vuex ORM issue board, you might want to add "stage-2" in the presets: https://github.com/vuex-orm/vuex-orm/issues/220

Other solution is to build the change-flag plugin with this option to convert to standard JS (or completely remove from the plugin).

tvillaren commented 5 years ago

@wkasem Any update on your issue?

wkasem commented 5 years ago

@tvillaren no i haven't figured it out yet , i have tried , stage-2 preset and tried to remove all presets , everything else is compiled successfully but this plugin !!

jasir commented 4 years ago

I have the same problem, this plugin breaks edge compatibility.

SCRIPT1028: Expected identifier, string or number (in the dist file spread operator is used)

kiaking commented 4 years ago

Hmmm, I didn't know edge didn't support spread operator. Maybe we need polyfill for this?

We might need to refresh the build system to match other plugins such as Search and Axios and it might go away. Maybe I'll try this but if anyone has time to do it, more than welcome!