-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't loose comments when converting ESM to commonjs
- Loading branch information
1 parent
fb76e44
commit f355531
Showing
9 changed files
with
73 additions
and
10 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
4 changes: 4 additions & 0 deletions
4
packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/comments-2/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,4 @@ | ||
/* istanbul ignore file */ | ||
import * as Something from 'some-dep'; | ||
// a comment | ||
// export default function() {} |
4 changes: 4 additions & 0 deletions
4
packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/comments-2/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,4 @@ | ||
{ | ||
"externalHelpers": true, | ||
"plugins": ["transform-modules-commonjs"] | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/comments-2/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,6 @@ | ||
"use strict"; | ||
|
||
/* istanbul ignore file */ | ||
var Something = babelHelpers.interopRequireWildcard(require("some-dep")); | ||
// a comment | ||
// export default function() {} |
11 changes: 11 additions & 0 deletions
11
packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/comments/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,11 @@ | ||
// a comment | ||
import { useState } from "react"; | ||
|
||
// another comment | ||
import "react-dom"; | ||
|
||
/* a third comment */ | ||
import * as R from "react"; | ||
|
||
// a class | ||
class A extends useState(R) {} |
4 changes: 4 additions & 0 deletions
4
packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/comments/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,4 @@ | ||
{ | ||
"externalHelpers": true, | ||
"plugins": ["transform-modules-commonjs"] | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/comments/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,12 @@ | ||
"use strict"; | ||
|
||
// a comment | ||
|
||
/* a third comment */ | ||
var R = babelHelpers.interopRequireWildcard(require("react")); | ||
|
||
// another comment | ||
|
||
// a class | ||
require("react-dom"); | ||
class A extends (0, R.useState)(R) {} |