Closed
Description
Hello.
When using gitpkg in repos with type "module" the configuration file is not loaded.
I logged the error thrown when trying to load the file below.
Is it possible to load .js/.cjs/.mjs?
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/pdan/Work/PDan/vue-keyboard-trap/gitpkg.config.js from .config/yarn/global/node_modules/gitpkg/build/tasks/Task/read-config.js not supported.
gitpkg.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 gitpkg.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 vue-keyboard-trap/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
Metadata
Metadata
Assignees
Labels
No labels