We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6ff567 commit da12cf9Copy full SHA for da12cf9
packages/commonjs/types/index.d.ts
@@ -55,6 +55,22 @@ interface RollupCommonJSOptions {
55
* like `"/Users/John/Desktop/foo-project/"` -> `"/"`.
56
*/
57
dynamicRequireTargets?: string | ReadonlyArray<string>;
58
+ /**
59
+ * Controls what is returned when requiring an ES module or external dependency
60
+ * from a CommonJS file. By default, this plugin will render it as a namespace
61
+ * import, i.e.
62
+ *
63
+ * ```js
64
+ * // input
65
+ * const foo = require('foo');
66
67
+ * // output
68
+ * import * as foo from 'foo';
69
+ * ```
70
71
+ * @default false
72
+ */
73
+ requireReturnsDefault?: boolean | 'auto' | 'preferred' | ((id: string) => boolean | 'auto' | 'preferred');
74
}
75
76
/**
0 commit comments