Roman86 / tailwindcss-scoped-preflight

To avoid style conflicts (CSS collisions/interference side effects) when using Tailwind CSS with other UI libraries like Antd, Vuetify etc.
MIT License
111 stars 5 forks source link

Import errors with Vite?? #2

Closed OluAgunloye closed 9 months ago

OluAgunloye commented 10 months ago

Error: .../node_modules/tailwindcss-scoped-preflight/dist/plugin.mjs not supported. Instead change the require of .../node_modules/tailwindcss-scoped-preflight/dist/plugin.mjs to a dynamic import() which is available in all CommonJS modules.

OluAgunloye commented 10 months ago

This works just fine so long as your tailwind and postcss config files are pure js not cjs btw.

Roman86 commented 10 months ago

@OluAgunloye could you please share a minimal reproducible project boilerplate so I could play with it?

I just made one with vite - out of the box I had issue with postcss until changed the provided package.json "type" from "module" to "commonjs". The plugin is installing and working just fine. Readme there is generic, you may ignore it - just checkout, install dependencies and run.

Roman86 commented 9 months ago

@OluAgunloye just released v1.2.0 - it may resolve the require issue, if it's your case. Please check

Roman86 commented 9 months ago

as mentioned 3 weeks ago, it should have been fixed, closing for now. @OluAgunloye Please try the new version and if it doesn't fix your issue - feel free to reopen but provide a minimal reproducible project with your case

OluAgunloye commented 8 months ago

Sorry, didn't see this until today. It works!

On Wed, Feb 7, 2024, 8:23 AM Roman Kozodoi @.***> wrote:

Closed #2 https://github.com/Roman86/tailwindcss-scoped-preflight/issues/2 as completed.

— Reply to this email directly, view it on GitHub https://github.com/Roman86/tailwindcss-scoped-preflight/issues/2#event-11732379273, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSPVKVK3OR2IQOV2SF63SLYSN53ZAVCNFSM6AAAAABBIQCBDWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRG4ZTEMZXHEZDOMY . You are receiving this because you were mentioned.Message ID: <Roman86/tailwindcss-scoped-preflight/issue/2/issue_event/11732379273@ github.com>