-
-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(commonjs): reconstruct real es module from __esModule marker
- Loading branch information
1 parent
e4d21ba
commit c239a73
Showing
20 changed files
with
258 additions
and
339 deletions.
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
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
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
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/form/compiled-esm-assign-exports/input.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,3 @@ | ||
exports.__esModule = true; | ||
exports.default = 'x'; | ||
exports.foo = 'foo'; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/compiled-esm-assign-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,5 @@ | ||
var _default = 'x'; | ||
var foo = 'foo'; | ||
|
||
export default _default; | ||
export { foo }; |
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/form/compiled-esm-assign-module/input.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,3 @@ | ||
module.exports.__esModule = true; | ||
module.exports.default = 'x'; | ||
module.exports.foo = 'foo'; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/compiled-esm-assign-module/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,5 @@ | ||
var _default = 'x'; | ||
var foo = 'foo'; | ||
|
||
export default _default; | ||
export { foo }; |
4 changes: 4 additions & 0 deletions
4
packages/commonjs/test/fixtures/form/compiled-esm-deconflict/input.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,4 @@ | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.foo = 'bar'; | ||
|
||
const foo = 'also bar'; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/compiled-esm-deconflict/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,5 @@ | ||
var foo_1 = 'bar'; | ||
|
||
const foo = 'also bar'; | ||
|
||
export { foo_1 as foo }; |
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/form/compiled-esm-define/input.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,3 @@ | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.default = 'x'; | ||
exports.foo = 'foo'; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/compiled-esm-define/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,5 @@ | ||
var _default = 'x'; | ||
var foo = 'foo'; | ||
|
||
export default _default; | ||
export { foo }; |
2 changes: 2 additions & 0 deletions
2
packages/commonjs/test/fixtures/form/compiled-esm-minified/input.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,2 @@ | ||
Object.defineProperty(exports, '__esModule', { value: !0 }); | ||
exports.foo = 'foo'; |
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/form/compiled-esm-minified/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,3 @@ | ||
var foo = 'foo'; | ||
|
||
export { foo }; |
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/form/compiled-esm-only-named/input.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,3 @@ | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.foo = 'bar'; | ||
exports.bar = 'foo'; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/compiled-esm-only-named/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,5 @@ | ||
var foo = 'bar'; | ||
var bar = 'foo'; | ||
|
||
export { foo }; | ||
export { bar }; |
6 changes: 0 additions & 6 deletions
6
packages/commonjs/test/fixtures/function/transpiled-esm-entry-named/main.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 |
---|---|---|
@@ -1,11 +1,5 @@ | ||
import * as entry from './entry.js'; | ||
|
||
t.deepEqual(entry, { | ||
// Technically, this should ideally not exist, or if we cannot avoid it due | ||
// to runtime default export detection, it should probably be undefined. We | ||
// return the namespace instead as this will fix | ||
// rollup/rollup-plugin-commonjs#224 until the remaining Rollup interop has | ||
// been updated | ||
default: { named: 'named' }, | ||
named: 'named' | ||
}); |
Oops, something went wrong.