chalk/supports-color





The issue has been closed
Change to ESM causes backwards compatibility issues #116
yinzara posted onGitHub
The cordova-webpack-plugin
depends on supports-color
. All versions 8.1.1 and earlier work fine with the plugin however when upgrading to supports-color
9.0.0 I get the following error:
require() of /pathto/mycordovaproject/node_modules/supports-color/index.js from /pathto/mycordovaproject/plugins/cordova-plugin-webpack/dist/options/webpack.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /pathto/mycordovaproject/node_modules/supports-color/package.json.