Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Dec 22, 2022
1 parent 150e3f4 commit 8a645ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/babel-core/package.json
Expand Up @@ -77,6 +77,14 @@
"rimraf": "^3.0.0",
"ts-node": "^10.9.1"
},
"peerDependencies": {
"@babel/preset-typescript": "^7.0.0"
},
"peerDependenciesMeta": {
"@babel/preset-typescript": {
"optional": true
}
},
"conditions": {
"BABEL_8_BREAKING": [
null,
Expand Down
12 changes: 11 additions & 1 deletion packages/babel-core/src/config/files/module-types.ts
Expand Up @@ -68,7 +68,17 @@ function loadCtsDefault(filepath: string) {
filename: path.basename(filepath),
sourceType: "script",
sourceMaps: "inline",
presets: ["@babel/preset-typescript"],
presets: [
[
"@babel/preset-typescript",
{
allowDeclareFields: true,
disallowAmbiguousJSXLike: true,
onlyRemoveTypeImports: true,
optimizeConstEnums: true,
},
],
],
};
const result = transformSync(code, opts);
require.extensions[ext] = function (m, filename) {
Expand Down

0 comments on commit 8a645ff

Please sign in to comment.