Parser options for javascript modules.
Set the value of require.amd and define.amd. Or disable AMD support.
booleanSet .name to "default" for anonymous default export functions and classes per ES spec. Disable to reduce output size when .name is not needed.
booleanEnable/disable special handling for browserify bundles.
booleanEnable/disable parsing of CommonJs syntax.
booleanEnable/disable parsing of magic comments in CommonJs syntax.
Enable/disable parsing "import createRequire from "module"" and evaluating createRequire().
booleanEnable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
Auto-emit <link rel="preload" as="style"> for the CSS of every dynamically imported (import()) chunk, so the stylesheet fetches in parallel with the chunk's JavaScript instead of after it parses. Unlike dynamicImportPreload, the JavaScript itself is not preloaded. true uses the default order; a number sets the preload order.
false | "auto" | "high" | "low"Specifies global fetchPriority for dynamic import.
"eager" | "weak" | "lazy" | "lazy-once"Specifies global mode for dynamic import.
Specifies global prefetch for dynamic import.
Specifies global preload for dynamic import.
booleanEnable/disable parsing of dynamic URL.
false | "error" | "warn" | "auto"Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
booleanEnable warnings for full dynamic dependencies.
booleanEnable recursive directory lookup for full dynamic dependencies.
Sets the default regular expression for full dynamic dependencies.
stringSet the default request for full dynamic dependencies.
booleanEnable/disable parsing of EcmaScript Modules syntax.
booleanEnable/disable parsing of import() syntax.
false | "error" | "warn" | "auto"Specifies the behavior of invalid export names in "import ... from ...".
boolean | "preserve-unknown" | ImportMetaParserOptionsEnable/disable evaluating import.meta. Set to 'preserve-unknown' or an object to preserve unknown properties for runtime evaluation.
booleanDeprecated in favor of "importMeta" object option with a "webpackContext" field. Enable/disable evaluating import.meta.webpackContext.
false | NodeOptionsInclude polyfills or mocks for various node stuff.
"strict" | "non-strict"Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
javascriptParserOptions.parse(code, options): ParseResult
Function to parser source code.
string[]Mark the listed top-level function names for pure-function-based tree shaking.
false | "error" | "warn" | "auto"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.
booleanEnable/disable parsing of require.context syntax.
booleanEnable/disable parsing of require.ensure syntax.
booleanEnable/disable parsing of require.include syntax.
booleanEnable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
booleanEnable experimental tc39 proposal https://github.com/tc39/proposal-source-phase-imports. This allows importing modules at source phase.
booleanDeprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
false | "error" | "warn"Specifies the behavior of constructs that break at runtime in strict mode (e.g. 'with', 'arguments.callee', assigning to read-only globals) when modules are emitted as ES module output.
booleanHandle the this context correctly according to the spec for namespace objects.
booleanEnable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
booleanEnable typescript support.
booleanEnable warnings when using the require function in a not statically analyse-able way.
booleanEnable recursive directory lookup when using the require function in a not statically analyse-able way.
Sets the regular expression when using the require function in a not statically analyse-able way.
stringSets the request when using the require function in a not statically analyse-able way.
boolean | "relative"Enable/disable parsing of new URL() syntax.
UrlHintRule[]URL-referenced-asset default hint rules for this parser (JavaScript new URL(...), CSS url(...), HTML <img src> / <link href> / <script src>).
Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
Disable or configure parsing of Worklet syntax like context.audioWorklet.addModule() or CSS.paintWorklet.addModule().
booleanEnable warnings for partial dynamic dependencies.
booleanEnable recursive directory lookup for partial dynamic dependencies.
RegExpSet the inner regular expression for partial dynamic dependencies.