-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat: support quasar.conf(ig).cjs #15756
Conversation
#9455 I would like to use Quasar with `"type": "module"` in my `package.json`. Without converting file to `cjs` I get an error from Node: ``` Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/zerdox/p/cryp/table-cups/quasar.config.js from /Users/zerdox/p/cryp/table-cups/node_modules/@quasar/app-vite/lib/quasar-config-file.js not supported. quasar.config.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules. Instead rename quasar.config.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /Users/zerdox/p/cryp/table-cups/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead). at QuasarConfFile.read (/Users/zerdox/p/cryp/table-cups/node_modules/@quasar/app-vite/lib/quasar-config-file.js:204:30) at build (/Users/zerdox/p/cryp/table-cups/node_modules/@quasar/app-vite/lib/cmd/build.js:134:43) { code: 'ERR_REQUIRE_ESM' } App •⚠️ FAIL quasar.config.js has JS errors ``` Please let me stick with ESM :)
Hi, This has already been worked on for next q/app major versions (which will also support everything in ESM format, including the quasar config file). However, adding this to the current q/apps will be nice as well. BUT, I need to release the new global Quasar CLI first, otherwise commands through it will still fail to recognize the folder as being a Quasar project. So you will need to be a little patient until I can release the new q/cli. |
Yeah. I stumbled upon this issue when I found out that my docker was running CLI directly. I just changed it to running to Good luck with a major release 👍 UPD: I also am not sure about webpack. Does it need changes too? I don't use it so I didn't provide any changes for webpack users |
Merged it, but will add more commits to it otherwise it will break some Quasar modes due to project's |
Out of curiosity, why do you need type: module? Because Electron and SSR do not support it (only SSR with Vite will). |
…ss/babel/eslint config files; normalize create-quasar config files #15756
#9455 I would like to use Quasar with
"type": "module"
in mypackage.json
.Without converting file to
cjs
I get an error from Node:What kind of change does this PR introduce?
Please let people stick with ESM :)
Does this PR introduce a breaking change?
The PR fulfills these requirements:
dev
branch (orv[X]
branch)fix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
Not supporting ESM is a bug obv