Conversation
|
I think we can make use of |
|
as requested in the discord, i will post my own experience with esm migration of non-quasar projects here. import {readFile} from 'fs/promises';
async function importJson (relativePath, importMetaUrl) {
if (!importMetaUrl) {
throw new Error('missing importMetaUrl');
}
return JSON.parse(await readFile(new URL(relativePath, importMetaUrl), 'utf8'));
}
export {importJson}for my projects, i replaced occurrences of on the upside, most node fs functions seem to support instances of |
|
|
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
devbranch and not themasterbranchfix: #xxx[,#xxx], where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
No docs explaining how to take advantage of this yet.
In short:
type: "module"to yourpackage.json.cjs:quasar.conf.js,.postcssrc.js,babel.conf.js,.eslintrc.js(optional) andjest.config.js(optional)Some projects would need to delete their
yarn.lockto force-update babel dependencies to use version>=7.7.0(previous versions doesn't support.cjsconfig file).Updating
@quasar/babel-preset-appwould solve the problem.I dunno if it could be useful for #5893
I actually did it for a project of mine for which I was forced to enable native ES modules due to some constraints, I didn't checked if it could solve that issue too