File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -272,10 +272,7 @@ export function resolveBuildPlugins(config: ResolvedConfig): {
272272 return {
273273 pre : [
274274 buildHtmlPlugin ( config ) ,
275- commonjsPlugin ( {
276- ignoreDynamicRequires : true ,
277- ...options . commonjsOptions
278- } ) ,
275+ commonjsPlugin ( options . commonjsOptions ) ,
279276 dataURIPlugin ( ) ,
280277 dynamicImportVars ( options . dynamicImportVarsOptions ) ,
281278 assetImportMetaUrlPlugin ( config ) ,
Original file line number Diff line number Diff line change @@ -41,6 +41,18 @@ export interface RollupCommonJSOptions {
4141 * @default true
4242 */
4343 sourceMap ?: boolean
44+ /**
45+ * Some `require` calls cannot be resolved statically to be translated to
46+ * imports.
47+ * When this option is set to `false`, the generated code will either
48+ * directly throw an error when such a call is encountered or, when
49+ * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
50+ * configured dynamic require target.
51+ * Setting this option to `true` will instead leave the `require` call in the
52+ * code or use it as a fallback for `dynamicRequireTargets`.
53+ * @default false
54+ */
55+ ignoreDynamicRequires ?: boolean
4456 /**
4557 * Instructs the plugin whether to enable mixed module transformations. This
4658 * is useful in scenarios with modules that contain a mix of ES `import`
You can’t perform that action at this time.
0 commit comments