mirror of
https://github.com/halo-dev/docs.git
synced 2025-10-19 00:38:24 +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",
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
Reference in New Issue
Block a user