diff --git a/src/content/configuration/module.mdx b/src/content/configuration/module.mdx index 39e1d8a829c7..9499f8406a6c 100644 --- a/src/content/configuration/module.mdx +++ b/src/content/configuration/module.mdx @@ -238,6 +238,8 @@ module.exports = { // Parser options for javascript modules // e.g, enable parsing of require.ensure syntax requireEnsure: true, + // Set the module to `'strict'` or `'non-strict'` mode. This can affect the module's behavior, as some behaviors differ between strict and non-strict modes. + overrideStrict: 'non-strict', }, 'javascript/auto': { // ditto @@ -528,6 +530,26 @@ Enable/disable evaluating [`import.meta.webpackContext`](/api/module-variables/# }; ``` +#### module.parser.javascript.overrideStrict + +Set the module to `'strict'` or `'non-strict'` mode. This can affect the module's behavior, as some behaviors differ between strict and non-strict modes. + +- Type: `'strict' | 'non-strict'` +- Available: 5.93.0+ +- Example: + + ```js + module.exports = { + module: { + parser: { + javascript: { + overrideStrict: 'non-strict', + }, + }, + }, + }; + ``` + #### module.parser.javascript.reexportExportsPresence Specifies the behavior of invalid export names in `\"export ... from ...\"`. This might be useful to disable during the migration from `\"export ... from ...\"` to `\"export type ... from ...\"` when reexporting types in TypeScript.