fix(static-module-record): Do not mark live binding for non-exported name
MODIFY
packages/static-module-record/src/babelPlugin.js
packages/static-module-record/src/babelPlugin.js
@@ -186,15 +186,6 @@ function makeModulePlugins(options) {
),
);
markLiveExport(name);
- } else {
- // Make this variable mutable with: let name = $c_name;
- soften(id);
- replacements.push(
- t.variableDeclaration('let', [
- t.variableDeclarator(t.identifier(name), t.identifier(id.name)),
- ]),
- );
- markLiveExport(name);
}
} else if (topLevelExported[name]) {
if (needsHoisting) {

MODIFY
packages/static-module-record/test/test-static-module-record.js
packages/static-module-record/test/test-static-module-record.js
@@ -737,7 +737,7 @@ test('static module records do not duplicate comments', t => {
});
// Regression test for immer@9.0.6
-test.failing('should handle package "immer" source', t => {
+test('should handle package "immer" source', t => {
const { __fixedExportMap__, __liveExportMap__ } = new StaticModuleRecord(
readFixture('fixtures/immer.js'),
);

fix(static-module-record): Do not mark live binding for non-exported name