mirror of
https://github.com/duhanbalci/dexpr.git
synced 2026-07-02 08:29:16 +00:00
initial commit
This commit is contained in:
21
editor/node_modules/fix-dts-default-cjs-exports/dist/rollup.mjs
generated
vendored
Normal file
21
editor/node_modules/fix-dts-default-cjs-exports/dist/rollup.mjs
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { i as internalFixDefaultCJSExports } from './utils-DwzdDEfz.mjs';
|
||||
import 'magic-string';
|
||||
import 'mlly';
|
||||
|
||||
function cjsExportsDtsMatcher(info) {
|
||||
return info.type === "chunk" && info.exports?.length > 0 && info.exports.includes("default") && /\.d\.c?ts$/.test(info.fileName);
|
||||
}
|
||||
function defaultCjsExportsDtsMatcher(info) {
|
||||
return cjsExportsDtsMatcher(info) && info.isEntry;
|
||||
}
|
||||
function FixDtsDefaultCjsExportsPlugin(options = {}) {
|
||||
const { matcher = defaultCjsExportsDtsMatcher } = options;
|
||||
return {
|
||||
name: "fix-dts-default-cjs-exports-plugin",
|
||||
renderChunk(code, info) {
|
||||
return matcher(info) ? internalFixDefaultCJSExports(code, info, options) : void 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { FixDtsDefaultCjsExportsPlugin, cjsExportsDtsMatcher, defaultCjsExportsDtsMatcher };
|
||||
Reference in New Issue
Block a user