Skip to content

languageOptions

See the source

Configures the ECMAScript version and module source type for your project.

OptionDefault
ecmaVersion"latest"
sourceType"module"
uglify({
with: ["languageOptions"],
options: {
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
additionalGlobals: {
myGlobal: "readonly",
},
},
},
})

The ECMAScript version to parse. Default: "latest".

Either "module" (ESM) or "commonjs". Default: "module".

An object of additional global variables to define. Keys are variable names, values are "readonly" or "writable".