Closed Heziode closed 4 years ago
module.exports and export are normally possible to use together. Is the error above reported by your linter or packager? It should be possible to resolve it by adjusting the settings in their configuration.
The error is just throw by nuxt when rendering.
I use vue-i18n like this:
// This is the plugin file imported in `nuxt.config.js`
export default () => {
return {
locale: "en",
fallbackLocale: 'en',
messages: {
en: require('../lang/en.json'),
},
pluralizationRules: require('./vue-i18n-plural.js')
}
}
Then it looks like a problem with your packager (rollup?) configuration.
Despite that I could image a --es6 option at cli.js that would alter https://github.com/avast/vuei18n-po/blob/master/index.js#L91 to an ES6 export. I would accept a pull request along these lines and release a new version.
included in 1.3.0 and available on npmjs. many thanks!
I got this error:
Cannot assign to read only property 'exports' of object '#<Object>'
.This is due to plural js generated file, that use the "old node syntax":
I encouter this issue because I use vue-i18n in nuxt (via nuxt-i18n), and to configure the plugin, I use an es6 file. So, you should add the possibility to choose the new syntax, and keep old by default for retro-compatibility (IHMO):