mirror of
https://github.com/halo-dev/docs.git
synced 2025-10-21 10:17:34 +00:00
chore: use swc instead of esbuild (#359)
使用 swc 代替 esbuild,之前在 https://github.com/halo-dev/docs/pull/358 中引入了 esbuild,但发现在生产构建之后会出现这个问题: <img width="1912" alt="image" src="https://github.com/halo-dev/docs/assets/21301288/5dcd724d-3876-4e58-b902-1818dd9d1fbd"> 暂时不清楚为什么,使用 swc 测试构建之后没有这个问题。 /kind bug ```release-note None ```
This commit is contained in:
@@ -256,11 +256,18 @@ const config = {
|
||||
],
|
||||
webpack: {
|
||||
jsLoader: (isServer) => ({
|
||||
loader: require.resolve('esbuild-loader'),
|
||||
loader: require.resolve("swc-loader"),
|
||||
options: {
|
||||
loader: 'tsx',
|
||||
format: isServer ? 'cjs' : undefined,
|
||||
target: isServer ? 'node12' : 'es2017',
|
||||
jsc: {
|
||||
parser: {
|
||||
syntax: "typescript",
|
||||
tsx: true,
|
||||
},
|
||||
target: "es2017",
|
||||
},
|
||||
module: {
|
||||
type: isServer ? "commonjs" : "es6",
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
@@ -47,9 +47,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "^2.4.1",
|
||||
"esbuild-loader": "^4.1.0",
|
||||
"@swc/core": "^1.5.7",
|
||||
"husky": "^7.0.4",
|
||||
"markdownlint": "^0.25.1",
|
||||
"markdownlint-cli2": "^0.4.0"
|
||||
"markdownlint-cli2": "^0.4.0",
|
||||
"swc-loader": "^0.2.6"
|
||||
}
|
||||
}
|
||||
|
676
pnpm-lock.yaml
generated
676
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user