Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🦀 SWC Integration #179

Merged
merged 11 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
Copy link
Owner

@dawsbot dawsbot Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never needed a .swcrc before, what happened without this? Some of these settings look like duplicates of the tsconfig, where-in my normal method of using swc inherits the tsconfig with no extra files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't previously test without a .swcrc as I assumed it was needed for specifying the configs. It was repeative information and didn't have an effect on the using swc.

Main goal was to experiment with .swcrc and modules to specify commonjs/ems/umd - but realized that it was repetitive and not working

"$schema": "https://json.schemastore.org/swcrc",
"module": {
"type": "commonjs",
"strict": false,
"strictMode": true,
"lazy": false,
"noInterop": false
},
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"dynamicImport": false,
"decorators": false
},
"target": "es5",
"loose": false,
"externalHelpers": false
},
"minify": false
}
6,688 changes: 1,694 additions & 4,994 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"compile": "npm-run-all --parallel build:esm build:cjs build:umd",
"build": "rm -rf dist && npm run compile",
"build:esm": "tsc -p tsconfig.json",
"build:cjs": "tsc -p tsconfig-cjs.json",
"build:cjs": "swc src -d dist/cjs --config-file .swcrc",
"build:umd": "microbundle --external none --format umd",
"build:readme": "bash ./scripts/markdown-magic/build-readme.sh",
"jest": "jest",
Expand All @@ -62,6 +62,8 @@
},
"devDependencies": {
"@size-limit/preset-small-lib": "^7.0.8",
"@swc/cli": "^0.1.57",
"@swc/core": "^1.3.21",
"@types/body-parser": "^1.19.1",
"@types/eslint": "^8.4.2",
"@types/express": "^4.17.13",
Expand Down
8 changes: 0 additions & 8 deletions test/global-setup.js

This file was deleted.

5 changes: 0 additions & 5 deletions test/global-teardown.js

This file was deleted.

2 changes: 0 additions & 2 deletions test/jest.setup-after-env.js

This file was deleted.

24 changes: 0 additions & 24 deletions test/server.js

This file was deleted.

1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"ts-node": {
"swc": true,
"compilerOptions": {
"module": "commonjs"
}
Expand Down