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

feat: support quasar.conf(ig).cjs #15756

Merged
merged 2 commits into from
Apr 29, 2023
Merged

feat: support quasar.conf(ig).cjs #15756

merged 2 commits into from
Apr 29, 2023

Commits on Apr 26, 2023

  1. feat: support quasar.conf(ig).cjs

    #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 :)
    ZerdoX-x committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    b647411 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2023

  1. Update app-paths.js

    rstoenescu committed Apr 29, 2023
    Configuration menu
    Copy the full SHA
    cdf613f View commit details
    Browse the repository at this point in the history