How to two package.json scripts with different types module and commonjs

Viewed 18

I have two scripts in package.json

{
  "type": "module",
  "scripts": {
    "webpack": "webpack", // using type: module
    "compile": "node compile.js" // using type: commonjs
  }
}

in type I can choose module or commonjs. But I have two different scripts, one should use module and the other should use commonjs.

Is it possible to determine that. Is there any flag or way to do it?

0 Answers
Related