cjs-override
Overrides the source type to "commonjs" for .cjs files. Use this when your project is primarily ESM but has some CommonJS files.
What it does
Section titled “What it does”Sets languageOptions.sourceType to "commonjs" for files matching the pattern.
Default file patterns
Section titled “Default file patterns”["**/*.cjs"]Options
Section titled “Options”uglify({ with: ["cjs-override"], options: { "cjs-override": { files: ["**/*.cjs", "legacy/**/*.js"], }, },})