-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo 'oxc' | ||
/usr/bin/time -alh node ./src/memory/oxc.js | ||
|
||
echo 'swc' | ||
/usr/bin/time -alh node ./src/memory/swc.js | ||
|
||
echo 'babel' | ||
/usr/bin/time -alh node ./src/memory/babel.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,13 @@ | ||
import fs from "fs"; | ||
import { transformSync as babelTransform } from '@babel/core' | ||
let filename = "./fixtures/parser.ts"; | ||
const sourceText = fs.readFileSync(filename, "utf8"); | ||
babelTransform(sourceText, { | ||
filename, | ||
babelrc: false, | ||
comments: false, | ||
presets: [ | ||
"@babel/preset-typescript", | ||
["@babel/preset-react", { runtime: 'automatic' }], | ||
] | ||
}); |
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 @@ | ||
import fs from "fs"; | ||
import { transform as oxcTransform } from "oxc-transform"; | ||
let filename = "./fixtures/parser.ts"; | ||
const sourceText = fs.readFileSync(filename, "utf8"); | ||
oxcTransform(filename, sourceText); |
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,18 @@ | ||
import fs from "fs"; | ||
import { transformSync as swcTransform } from "@swc/core"; | ||
let filename = "./fixtures/parser.ts"; | ||
const sourceText = fs.readFileSync(filename, "utf8"); | ||
swcTransform(sourceText, { | ||
filename, | ||
swcrc: false, | ||
jsc: { | ||
target: "esnext", | ||
transform: { | ||
treatConstEnumAsEnum: true, | ||
react: { | ||
runtime: 'automatic' | ||
} | ||
}, | ||
preserveAllComments: false, | ||
} | ||
}); |