Skip to content

Commit

Permalink
fix: handle frozen default exports (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish authored Jun 26, 2023
1 parent 42bd304 commit d7e6226
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/lib/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,7 @@ export const escapeRegex = (str: string) => {
};

export const commonJsTemplate = ({ importPath }: { importPath: string }) => {
return `
const polyfill = require('${importPath}')
if (polyfill && polyfill.default) {
module.exports = polyfill.default
for (let k in polyfill) {
module.exports[k] = polyfill[k]
}
} else if (polyfill) {
module.exports = polyfill
}
`;
return `export * from '${importPath}'`;
};

const normalizeNodeBuiltinPath = (path: string) => {
Expand Down

0 comments on commit d7e6226

Please sign in to comment.