solidjs-community / solid-lib-starter

SolidJS library starter template. Use it to create your own solid package.
MIT License
99 stars 9 forks source link

baseUrl tsconfig not working nicely with tsup/tsup-preset-solid #3

Closed bigmistqke closed 1 year ago

bigmistqke commented 1 year ago

A baseUrl is defined in the tsconfig, but isn't in tsup-preset-solid: this causes an error.

// from index.ts
import Example from 'src/Example'

Example // will be typed correctly.

But when running dev: Failed to resolve import "src/Example" from "src/index.ts". Does the file exist?

thetarnav commented 1 year ago

when using tsup-preset-solid tsup options can be overwritten with the tsupOptions key. Not sure if there is an option for the base URL specifically though.

{
  tsupOptions(options) {
    // do whatever to options
    return options;
  },
}
bigmistqke commented 1 year ago

On further inspection it didn't had anything to do with the tsup config, but with dev/vite.config.ts instead. Made a PR to add a path-alias

thetarnav commented 1 year ago

it's resolved now I believe