Vuex-persistedstate: package.json "module" points to ES6 instead of ESM build

Created on 22 Nov 2017  路  3Comments  路  Source: robinvdvleuten/vuex-persistedstate

Do you want to request a feature or report a bug?

bug, but not quite sure

What is the current behavior?

webpack build contains const breaking older browsers


By default Webpack resolves the "module" property before "main" (resolve.mainFields), meaning that index.js is imported. However it is uncommon to transpile code from node_modules. As far as I understand things the "module" property should point to a file that contains transpiled code exporting its contents in ESM rather than CommonJS. As of v2.4.0 "module" points to raw ES6.


If I understand this correctly, you're simply missing another build target using format: 'es' in https://github.com/robinvdvleuten/vuex-persistedstate/blob/master/rollup.config.js#L20-L23

bug

All 3 comments

@rodneyrehm thanks for filing this as an issue! Initially before version v2.4.0, I also pointed to the index.js as source file but wasn't using a const but a var instead. I'll fix it immediately by indeed adding the format: es as additional output.

Fixed by #98

Your problem should be solved in v2.4.2 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jerometremblay picture jerometremblay  路  6Comments

jafri picture jafri  路  6Comments

joefresco picture joefresco  路  6Comments

kylewelsby picture kylewelsby  路  5Comments

wiadev picture wiadev  路  5Comments