-
-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(commonjs): Add
defaultIsModuleExports
option to match Node.js …
…behavior (#838) * [commonjs] Add `nodeDefaultImport` option to match Node.js behavior * Undo unrelated changes * Undo editor autoformatter * Change option
- Loading branch information
1 parent
c328e2c
commit bfe60d3
Showing
25 changed files
with
201 additions
and
16 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
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
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-__esModule/_config.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 @@ | ||
module.exports = { | ||
options: { | ||
defaultIsModuleExports: 'auto' | ||
} | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-__esModule/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 = 2; | ||
exports.named = 3; |
11 changes: 11 additions & 0 deletions
11
packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-__esModule/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,11 @@ | ||
var _default = 2; | ||
var named = 3; | ||
|
||
var input = /*#__PURE__*/Object.defineProperty({ | ||
default: _default, | ||
named: named | ||
}, '__esModule', {value: true}); | ||
|
||
export default _default; | ||
export { input as __moduleExports }; | ||
export { named }; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-no-__esModule/_config.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 @@ | ||
module.exports = { | ||
options: { | ||
defaultIsModuleExports: 'auto' | ||
} | ||
}; |
2 changes: 2 additions & 0 deletions
2
packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-no-__esModule/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 @@ | ||
exports.default = 2; | ||
exports.named = 3; |
11 changes: 11 additions & 0 deletions
11
packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-no-__esModule/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,11 @@ | ||
var _default = 2; | ||
var named = 3; | ||
|
||
var input = { | ||
default: _default, | ||
named: named | ||
}; | ||
|
||
export default input; | ||
export { input as __moduleExports }; | ||
export { named }; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-__esModule/_config.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 @@ | ||
module.exports = { | ||
options: { | ||
defaultIsModuleExports: false | ||
} | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-__esModule/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 = 2; | ||
exports.named = 3; |
11 changes: 11 additions & 0 deletions
11
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-__esModule/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,11 @@ | ||
var _default = 2; | ||
var named = 3; | ||
|
||
var input = /*#__PURE__*/Object.defineProperty({ | ||
default: _default, | ||
named: named | ||
}, '__esModule', {value: true}); | ||
|
||
export default _default; | ||
export { input as __moduleExports }; | ||
export { named }; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-__esModule/_config.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 @@ | ||
module.exports = { | ||
options: { | ||
defaultIsModuleExports: false | ||
} | ||
}; |
2 changes: 2 additions & 0 deletions
2
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-__esModule/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 @@ | ||
exports.default = 2; | ||
exports.named = 3; |
11 changes: 11 additions & 0 deletions
11
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-__esModule/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,11 @@ | ||
var _default = 2; | ||
var named = 3; | ||
|
||
var input = { | ||
default: _default, | ||
named: named | ||
}; | ||
|
||
export default _default; | ||
export { input as __moduleExports }; | ||
export { named }; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-default/_config.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 @@ | ||
module.exports = { | ||
options: { | ||
defaultIsModuleExports: false | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-default/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 @@ | ||
exports.named = 3; |
9 changes: 9 additions & 0 deletions
9
packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-default/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,9 @@ | ||
var named = 3; | ||
|
||
var input = { | ||
named: named | ||
}; | ||
|
||
export default input.default; | ||
export { input as __moduleExports }; | ||
export { named }; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-__esModule/_config.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 @@ | ||
module.exports = { | ||
options: { | ||
defaultIsModuleExports: true | ||
} | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-__esModule/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 = 2; | ||
exports.named = 3; |
11 changes: 11 additions & 0 deletions
11
packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-__esModule/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,11 @@ | ||
var _default = 2; | ||
var named = 3; | ||
|
||
var input = /*#__PURE__*/Object.defineProperty({ | ||
default: _default, | ||
named: named | ||
}, '__esModule', {value: true}); | ||
|
||
export default input; | ||
export { input as __moduleExports }; | ||
export { named }; |
5 changes: 5 additions & 0 deletions
5
packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-no-__esModule/_config.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 @@ | ||
module.exports = { | ||
options: { | ||
defaultIsModuleExports: true | ||
} | ||
}; |
2 changes: 2 additions & 0 deletions
2
packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-no-__esModule/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 @@ | ||
exports.default = 2; | ||
exports.named = 3; |
11 changes: 11 additions & 0 deletions
11
packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-no-__esModule/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,11 @@ | ||
var _default = 2; | ||
var named = 3; | ||
|
||
var input = { | ||
default: _default, | ||
named: named | ||
}; | ||
|
||
export default input; | ||
export { input as __moduleExports }; | ||
export { named }; |