1

I have a JavaScript project where the frontend uses ES Modules (built with babel / webpack) and the backend uses CommonJS modules. All files use the .js extension. Given this mix and the file extension convention, I can't set "type": "module" in my project's package.json.

I'm using AVA to run unit tests across the frontend and backend. Is there a way to run the frontend tests as ES Modules and the backend tests as CommonJS modules?

Mark McKelvy
  • 3,328
  • 2
  • 19
  • 24

0 Answers0