Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unshadow
cjs
exports when transforming mutations (#14708)
* Add failing test * Unshadow `cjs` exports when transforming mutations
- Loading branch information
1 parent
5fdc5eb
commit 1261051
Showing
7 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
...ansform-modules-commonjs/test/fixtures/misc/local-exports-decl-with-esm-exports/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var exports = 1; | ||
|
||
export let x = 2; | ||
|
||
function fn() { | ||
x = 3; | ||
var exports = 4; | ||
} |
3 changes: 3 additions & 0 deletions
3
...form-modules-commonjs/test/fixtures/misc/local-exports-decl-with-esm-exports/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["transform-modules-commonjs"] | ||
} |
14 changes: 14 additions & 0 deletions
14
...ansform-modules-commonjs/test/fixtures/misc/local-exports-decl-with-esm-exports/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.x = void 0; | ||
var _exports = 1; | ||
let x = 2; | ||
exports.x = x; | ||
|
||
function fn() { | ||
exports.x = x = 3; | ||
var _exports2 = 4; | ||
} |