chore: use esbuild instead of babel (#358)

引入 esbuild,提升构建速度。

before:

<img width="777" alt="image" src="https://github.com/halo-dev/docs/assets/21301288/49d28d76-1c10-47c8-ac8c-31b41a31f6bd">

after:

<img width="888" alt="image" src="https://github.com/halo-dev/docs/assets/21301288/61462a4c-ba66-4612-9363-67e5d394601b">


/kind improvement

```release-note
None
```
This commit is contained in:
Ryan Wang
2024-05-28 11:42:57 +08:00
committed by GitHub
parent b4e637b4b0
commit ac0b158b73
3 changed files with 294 additions and 3 deletions

View File

@@ -254,6 +254,16 @@ const config = {
},
],
],
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve('esbuild-loader'),
options: {
loader: 'tsx',
format: isServer ? 'cjs' : undefined,
target: isServer ? 'node12' : 'es2017',
},
}),
},
scripts: [
{
src: "https://analytics.halo.run/script.js",