Open
Description
While working on #671, I noticed that when you create a new Vue project using Vite, it specifies "type": "module"
in package.json. When I do so in Frontend, most things work. However, testing does not:
- karma.conf.js throws an error about the use of
require
. - I'm not able to replace
require
withimport
for the following line:central-frontend/karma.conf.js
Line 11 in c83d89d
- I tried to rename karma.conf.js to karma.conf.cjs, but that didn't work.
Therefore, I think this issue is blocked by #1211. However, I think we should make this change once #1211 is resolved. It'd be really nice for the scripts in bin/ to use ES modules instead of CommonJS. I've had trouble importing files from src/ into bin/. I suspect that once the scripts in bin/ are using ES modules, we'll be able to deduplicate/refactor some code (though that's outside the scope of this issue).
I think this is what we need to do:
- Add
"type": "module"
to package.json. - Replace
require
withimport
in bin/, and replacemodule.exports
withexport
. - Rename .eslintrc.js to .eslintrc.cjs.
- Update
npm run lint
andnpm run lint:fix
to include .cjs files.
Metadata
Metadata
Assignees
Type
Projects
Status
🕒 backlog