Skip to content
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

requesting an example with TailwindCSS #556

Open
alkber opened this issue Dec 23, 2024 · 2 comments
Open

requesting an example with TailwindCSS #556

alkber opened this issue Dec 23, 2024 · 2 comments

Comments

@alkber
Copy link

alkber commented Dec 23, 2024

It would be nice to have an example project, demonstrating the integration of TailwindCSS with KVision.

@rjaros
Copy link
Owner

rjaros commented Dec 29, 2024

Unfortunately I was not able to use TailwindCSS with KVision, because currently KVision doesn't support ES modules. The code generated by the Kotlin/JS compiler uses require() calls and this seems to be not supported by PostCSS Tailwind plugin:

Module Error (from ../../node_modules/postcss-loader/dist/cjs.js):
Loading PostCSS "tailwindcss" plugin failed: require() of ES Module /home/rjaros/git/kvision-examples/tailwindcss/build/js/node_modules/snabbdom/build/index.js from /home/rjaros/git/kvision-examples/tailwindcss/build/js/packages/tailwindcss/kotlin/kvision.js not supported.
Instead change the require of index.js in /home/rjaros/git/kvision-examples/tailwindcss/build/js/packages/tailwindcss/kotlin/kvision.js to a dynamic import() which is available in all CommonJS modules.

Changing KVision to support ES modules is probably possible, but will require some work and most probably will introduce breaking changes.

@alkber
Copy link
Author

alkber commented Dec 30, 2024

@rjaros thank you , for your time on this. No worries.

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

No branches or pull requests

2 participants