Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named import from json will be deprecated from webpack 5 #7943

Closed
renekaesler opened this issue Oct 23, 2020 · 1 comment
Closed

Named import from json will be deprecated from webpack 5 #7943

renekaesler opened this issue Oct 23, 2020 · 1 comment

Comments

@renekaesler
Copy link

Is your feature request related to a problem? Please describe.
When using Quasar with webpack 5 you will get the following console warnings:

Should not import the named export 'version' (imported as 'version') from default-exporting module (only default export is available soon)

The reason for this warning is the named import from json, wich webpack will not support in the future:

  • node_modules/quasar/src/install.js
  • node_modules/quasar/src/vue-plugin.js

Describe the solution you'd like
These warnings are really annoying. It would be nice if quasar will support webpack 5. The implementation is quite simple. The json file has to be imported as default & the version has to be accessed directly.

// install.js
// ==========

import pkg from '../package.json'

// ...previous code

export const $q = {
  version: pkg.version,
  config: {}
}


// vue-plugin.js
// =============

import install from './install.js'
import pkg from '../package.json'
import lang from './lang.js'
import iconSet from './icon-set.js'
import ssrUpdate from './ssr-update.js'

export default {
  version: pkg.version,
  install,
  lang,
  iconSet,
  ssrUpdate
}
@rstoenescu
Copy link
Member

Fixed for Quasar v2.

Unfortunately, it's not easy to backport the fix to Quasar v1 also without introducing a breaking change (a required minimum version of q/app). But as things stand, Quasar v1 won't get Webpack 5 anyways (too many heavy breaking changes would be required overall). So closing because of being fixed in future Quasar v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants