Skip to content

Commit

Permalink
refactor(build): use esbuild and tsx (element-plus#7876)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz authored May 24, 2022
1 parent b77753c commit 3d2a257
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 169 deletions.
2 changes: 0 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
ignoreDeps: [
'node',
'csstype',
'esno',

// pure esm
'chalk',

// test
'@vue/test-utils',

'cypress',
],
}
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"private": true,
"scripts": {
"dev": "pnpm gen-locale && vitepress dev .",
"build": "cross-env NODE_ENV=production && vitepress build . && sucrase-node .vitepress/build/rebuild-pwa.ts",
"build": "cross-env NODE_ENV=production && vitepress build . && tsx .vitepress/build/rebuild-pwa.ts",
"serve": "cross-env NODE_ENV=production vitepress serve . --port 5001",
"gen-locale": "rimraf .vitepress/i18n && sucrase-node .vitepress/build/crowdin-generate.ts",
"crowdin-credentials": "sucrase-node .vitepress/build/crowdin-credentials.ts"
"gen-locale": "rimraf .vitepress/i18n && tsx .vitepress/build/crowdin-generate.ts",
"crowdin-credentials": "tsx .vitepress/build/crowdin-credentials.ts"
},
"dependencies": {
"@docsearch/js": "^3.0.0",
Expand Down
5 changes: 3 additions & 2 deletions internal/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"start": "gulp --require sucrase/register/ts -f gulpfile.ts",
"start": "gulp --require @esbuild-kit/cjs-loader -f gulpfile.ts",
"dev": "pnpm run stub",
"stub": "unbuild --stub"
},
Expand All @@ -22,7 +22,7 @@
"@rollup/plugin-node-resolve": "^13.3.0",
"@vitejs/plugin-vue": "^2.3.3",
"@vitejs/plugin-vue-jsx": "^1.3.10",
"chalk": "^4.1.2",
"chalk": "^5.0.1",
"components-helper": "^2.0.0",
"consola": "^2.15.3",
"esbuild": "^0.14.39",
Expand All @@ -36,6 +36,7 @@
"unplugin-vue-define-options": "^0.6.1"
},
"devDependencies": {
"@esbuild-kit/cjs-loader": "^2.0.0",
"@pnpm/types": "^8.0.1",
"unbuild": "^0.7.4",
"vue": "^3.2.33"
Expand Down
10 changes: 5 additions & 5 deletions internal/metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
},
"scripts": {
"build": "concurrently \"pnpm run build:contributor\" \"pnpm run build:components\"",
"build:contributor": "esno src/contributor.ts",
"build:components": "esno src/components.ts",
"build:contributor": "tsx src/contributor.ts",
"build:components": "tsx src/components.ts",
"dev": "cross-env DEV=1 pnpm run build"
},
"devDependencies": {
"@element-plus/build": "^0.0.1",
"@element-plus/build-constants": "^0.0.1",
"@element-plus/build-utils": "^0.0.1",
"@types/lodash-es": "^4.17.6",
"chalk": "^4.1.2",
"chalk": "^5.0.1",
"concurrently": "^7.2.0",
"consola": "^2.15.3",
"cross-env": "^7.0.3",
"esno": "^0.14.1",
"fast-glob": "^3.2.11",
"lodash-es": "^4.17.21",
"octokit": "^1.7.1"
"octokit": "^1.7.1",
"tsx": "^3.4.0"
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"prepare:e2e": "if [ ! -d \"docs/.vitepress/dist\" ]; then pnpm run docs:build; fi;",
"dev": "pnpm -C play dev",
"gen": "bash ./scripts/gc.sh",
"gen:version": "sucrase-node scripts/gen-version.ts",
"diff:table": "sucrase-node scripts/build-table.ts",
"update:version": "sucrase-node scripts/update-version.ts",
"gen:version": "tsx scripts/gen-version.ts",
"diff:table": "tsx scripts/build-table.ts",
"update:version": "tsx scripts/update-version.ts",
"clean": "pnpm run clean:dist && pnpm run -r --parallel clean",
"clean:dist": "rimraf dist",
"build": "pnpm run -C internal/build start",
Expand Down Expand Up @@ -81,7 +81,7 @@
"@vue/test-utils": "^2.0.0-rc.21",
"@vue/tsconfig": "^0.1.3",
"c8": "^7.11.3",
"chalk": "^4.1.2",
"chalk": "^5.0.1",
"concurrently": "^7.2.0",
"consola": "^2.15.3",
"csstype": "^2.6.20",
Expand All @@ -99,8 +99,8 @@
"resize-observer-polyfill": "^1.5.1",
"rimraf": "^3.0.2",
"sass": "^1.51.0",
"sucrase": "^3.21.0",
"ts-morph": "^14.0.0",
"tsx": "^3.4.0",
"type-fest": "^2.12.2",
"typescript": "^4.6.4",
"unplugin-element-plus": "^0.4.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/theme-chalk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
"style": "index.css",
"scripts": {
"clean": "rimraf dist",
"build": "gulp --require sucrase/register/ts"
"build": "gulp --require @esbuild-kit/cjs-loader"
},
"devDependencies": {
"@element-plus/build": "workspace:*",
"@esbuild-kit/cjs-loader": "^2.0.0",
"@types/gulp-autoprefixer": "^0.0.33",
"@types/gulp-clean-css": "^4.3.0",
"@types/gulp-rename": "^2.0.1",
Expand Down
Loading

0 comments on commit 3d2a257

Please sign in to comment.