Skip to content

Conversation

userquin
Copy link
Owner

@userquin userquin commented Oct 3, 2025

Crazy experiment to generate statically analisable configuration. Works fine with the prepare command.

Pending tasks:

  • split tsdown build per template
  • ✔️ reload templates: requires previous step or find a way to do that (ask Daniel): not sure if we can generate virtual Nuxt module using just the ts file, maybe something we need to add at Nuxt (or maybe already there: we need to genarate the corresponding dts)
  • rn pnpm dev:prepare too slow ~2 seconds => HMR is quite fast ~210ms (check screenshot below)
  • prepare magicast to allow use local variables and load module meta info before merging (rn merging on the fly); we need to load meta data and then add the configuration

NOTE: I'll need to change the logic, we're sharing ssr, options and unocss virtual modules, there is a race condition on HMR and on SSR build: nuxt prepare runs globally, but HMR and SSR build will run 2 "builds", maybe @danielroe can help on this

Running pnpm dev will run the prepare command a few times.

The external playground not updated, this PR using a local tgz of Vuetify: vuetifyjs/vuetify#22152

HMR HMR

@userquin
Copy link
Owner Author

userquin commented Oct 4, 2025

ok, looks like Nuxt changing some internals at build time (or maybe the PROD env.), tsdown unable to generate/emit dts files, I need to check what's required here:

SSR build

chore: use tsconfig.json from nuxt build at tsdown build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant