HerringtonDarkholme / kilimanjaro

typed vuex 2.0
62 stars 4 forks source link

Error when using vue.esm.js #15

Open whitetrefoil opened 7 years ago

whitetrefoil commented 7 years ago

After I configured my webpack to use vue.runtime.esm.js instead of vue.runtime.common.js, this line throws error:

https://github.com/HerringtonDarkholme/kilimanjaro/blob/master/src/store.ts#L10

Is there a way to get it work with esm version but keep the compatibility of common version?

HerringtonDarkholme commented 7 years ago

You can specify webpack to use vue.runtime.common.js. https://webpack.js.org/configuration/resolve/

whitetrefoil commented 7 years ago

If I did nothing it just use common version by default, but I intentionally chose to use the esm version to kill the last import * as xxx from xxx in my code.😹

I'll try if using the source TS code instead of compiled JS code will help~