mirror of
https://github.com/alex8088/electron-vite.git
synced 2025-04-06 04:05:44 +08:00
fix: unreachable code
This commit is contained in:
parent
f81f57efbf
commit
bf0c83835a
@ -23,9 +23,11 @@ async function transformWithSWC(code: string, id: string, options: SwcTransformO
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
|
||||
const swc: typeof import('@swc/core') = require('@swc/core')
|
||||
let swc: typeof import('@swc/core')
|
||||
|
||||
if (!swc) {
|
||||
try {
|
||||
swc = require('@swc/core')
|
||||
} catch {
|
||||
throw new Error('swc plugin require @swc/core, you need to install it.')
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user