Skip to content

How to use spartan ui in Analog js ? #677

Answered by ajitzero
t1m4lc asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @t1m4lc - I finally figured out the issue, and it's a missing Vite config.

For local projects mentioned in the TS Config files, we need to inform Vite if we want that. Analog docs mentions this here: Using TypeScript Config Path Aliases.

I initially got it working with resolve.alias, but the plugin approach is better. See this commit: ajitzero/simple-analog-spartan-app@02fc3dc

In your case, install this:

pnpm install vite-tsconfig-paths --save-dev

And in the vite config file, add this:

import viteTsConfigPaths from 'vite-tsconfig-paths';

plugins: [
  analog({ ... }),
  viteTsConfigPaths(), // add this
],

This will pick up any local libraries mentioned in the tsconfig.json file.


This …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@t1m4lc
Comment options

@ajitzero
Comment options

Answer selected by t1m4lc
@t1m4lc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants