Skip to content

Is it possible to use flowbite-svelte with esbuild (in Rails)? #758

Answered by planetaska
planetaska asked this question in Q&A
Discussion options

You must be logged in to vote

I found the answer right after posted the question. I think I will leave the answer here just in case anyone had the same issue.
In short, I need to add a custom condition 'svelte' to esbuild, like so:

// this is in a customized esbuild config file esbuild.config.cjs

require("esbuild").context({
  entryPoints: ["application.js"],
  mainFields: ["svelte", "browser", "module", "main"],
  ...
  conditions: ['svelte'],
  ...
})

Hope it helped someone!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by planetaska
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant