-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SWC error: jsc.baseUrl
must be absolute
#41
Comments
Right now I solved this with manual import fs from 'node:fs'
import path from 'node:path'
import json5 from 'json5'
// HACK https://github.com/SukkaW/rollup-plugin-swc/issues/41
const tsconfig = json5.parse(fs.readFileSync(TSCONFIG_PATH))
const baseUrl = path.resolve(tsconfig.compilerOptions.baseUrl)
export default {
// rest skipped
plugins: [
swc({
tsconfig: TSCONFIG_PATH,
jsc: {
baseUrl,
},
}),
],
} |
Thanks for reporting this! However, rollup-plugin-swc3 also supports |
@SukkaW I am using plugin version: |
Problem
With the recent update(issues here and here), swc doesn't accept relative
baseUrl
anymore. When rollup plugin readstsconfig.json
, it passesbaseUrl
in whatever format is there, and normally, it is something like.
or./src
. It leads to errors:Suggested solution
If tsconfig file found, resolve
baseUrl
as absolute path (value from itscompilerOptions.baseUrl
field resolved against absolute path of the given tsconfig file)The text was updated successfully, but these errors were encountered: