Skip to content

Commit

Permalink
Revert "fix(commonjs): resolve export exports not found (rollup#1363)"
Browse files Browse the repository at this point in the history
This reverts commit 39a39d7.
  • Loading branch information
coderaiser committed Feb 28, 2023
1 parent bc5cf91 commit 3f8de2a
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 263 deletions.
11 changes: 3 additions & 8 deletions packages/commonjs/src/index.js
Expand Up @@ -243,15 +243,10 @@ export default function commonjs(options = {}) {
}

if (isWrappedId(id, MODULE_SUFFIX)) {
const module = getName(unwrapId(id, MODULE_SUFFIX));
const moduleExports = `${module}Exports`;
const name = getName(unwrapId(id, MODULE_SUFFIX));
return {
code: `var ${moduleExports} = {};
var ${module} = {
get exports(){ return ${moduleExports}; },
set exports(v){ ${moduleExports} = v; },
};
export {${module} as __module, ${moduleExports} as exports}`,
code: `var ${name} = {exports: {}}; export {${name} as __module}`,
syntheticNamedExports: '__module',
meta: { commonjs: { isCommonJS: false } }
};
}
Expand Down

0 comments on commit 3f8de2a

Please sign in to comment.