Skip to content

Commit

Permalink
perf: Add @swc/cli for speeding up build
Browse files Browse the repository at this point in the history
  • Loading branch information
hangxingliu committed Nov 20, 2023
1 parent e41bed2 commit a262ec6
Show file tree
Hide file tree
Showing 7 changed files with 542 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# vscode test web
.vscode-test-web

*.tsbuildinfo

/artifacts

# macos files
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.vscode
.vscode-test-web

*.tsbuildinfo

# github files
.github

Expand Down
18 changes: 18 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json.schemastore.org/swcrc",
"sourceMaps": true,
"minify": false,
"module": {
"type": "commonjs",
"noInterop": true
},
"jsc": {
"target": "es2022",
"parser": {
"syntax": "typescript",
"decorators": true
},
"preserveAllComments": true,
"keepClassNames": true
}
}
2 changes: 2 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# if I don't ignore node_modules, `vsce` will pack optional dependencies into the extension
node_modules

*.tsbuildinfo

# vscode test web
.vscode
.vscode-test-web
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
"browser": "./artifacts/web-ext/extension.js",
"scripts": {
"lint:eslint": "eslint --ext .js,.ts src test",
"build:desktop-ext": "tsc -p tsconfig.extension.json",
"dev:web-ext": "webpack",
"build:desktop-ext": "tsc -p tsconfig.extension.json",
"build:web-ext": "webpack --mode production --devtool hidden-source-map",
"build:utils": "tsc -p tsconfig.utils.json",
"swc:utils": "swc -d ./src -- ./src/utils/*.ts",
"build:syntax": "ts-node --project tsconfig.syntax.json ./src/syntax/generate-tmLanguage.ts",
"test:web-ext": "vscode-test-web --extensionDevelopmentPath=. --browser none",
"clean": "rimraf '.tsc' 'src/extension/**/*.js' 'src/utils/**/*.js'"
"clean": "rimraf --glob '.tsc' 'src/extension/**/*.{js,map}' 'src/utils/**/*.{js,map}'"
},
"extensionKind": [
"ui",
Expand All @@ -57,6 +58,7 @@
"webpack-cli": "^5"
},
"optionalDependencies": {
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.96",
"@typescript-eslint/eslint-plugin": "^6",
"@typescript-eslint/parser": "^6",
Expand All @@ -77,7 +79,8 @@
{
"id": "NGINX",
"aliases": [
"NGINX"
"NGINX",
"nginx"
],
"extensions": [
".conf",
Expand Down
1 change: 1 addition & 0 deletions tsconfig.utils.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"removeComments": false,
"target": "ES2022",
"sourceMap": false,
"incremental": true,
"skipLibCheck": true
},
"include": ["src/utils"]
Expand Down
Loading

0 comments on commit a262ec6

Please sign in to comment.