Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(commonjs): resolve export exports not found (#1363)" #1449

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 3 additions & 8 deletions packages/commonjs/src/index.js
Original file line number Diff line number Diff line change
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