-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Build for production with Vite? #268
Comments
Here's the line: vue-tailwind/src/base/Component.ts Line 38 in e35d734
|
Any news? @alfonsobries |
Any news? |
I have solved this issue by installing
|
Bit hacky, isn't it? |
Sure, but it worked for me as a quick fix for now. Of course, for vue v.2.7.x. |
This is what I was expecting to work, but I am still getting the same issue where |
I had this problem and I solved it by adding a plugin to my Vite config that modifies the vue-tailwind code: Here's the plugin const modifyVueTailwind = {
name: 'modifyVueTailwind',
transform(code, id) {
if (!/vue-tailwind\/dist\/(vue-tailwind|components)\.js/.test(id)) {
return
}
return code.replace(
"function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }",
"function _interopDefaultLegacy (e) { return e && (typeof e === 'object' || typeof e === 'function' ) && 'default' in e ? e : { 'default': e }; }",
)
}
} And then within my plugins array within plugins: [
vue(),
modifyVueTailwind,
// additional plugins ...
] You may need to modify the regex in the |
Has anyone gotten this package to work when building for production with Vite?
It seems like Vite is using two different methods to build for dev and prod (with rollup) and it only works for dev for me.
Thanks for tips!
The text was updated successfully, but these errors were encountered: