-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Tailwind changes no longer detected #386
Comments
I see you're working on the reproduction, but I just wanted to say, I like the gradient border and logo you've got, it looks very crisp 😎 |
Yeah, I am trying to reproduce on my own project. Go back a handful of commits to the point where it worked and then see how/where could I fu*k it up. Thanks, we could probably use something similar (animated border) for WXT examples too. 💯 |
From what I can tell looking at the example, the tailwind CSS file doesn't contain all the classes, just the ones present at build time. This is the usual behavior for production, obviously we want to strip out all the classes that aren't used, but in development, I thought tailwind's CSS file was populated with all it's classes... |
OK, so the problem is that when we render the HTML file to the file system (so that Chrome doesn't say "ERR can't find popup.html for action.default_popup" while loading the extension), the assets should be loaded from localhost, not from the extension's directory. This is because the code WXT uses to load ignores TSConfig path aliases 🤦 . The condition on line 60 is just looking for relative paths, and doesn't work with something like wxt/src/core/builders/vite/plugins/devHtmlPrerender.ts Lines 50 to 68 in 9cee9ee
|
To fix this:
|
Yeah, I am at that point now. Just looking at How the heck did you figure this so quickly? I went 30 commit behind, thinking it could be the src/public directory changes in the config. |
I can handle this, but I'm busy until tomorrow after noon, so it will be a while. For now, use relative paths instead of |
Given the input, I'll try to add make this and see if it works. If I fail, I'll simply wait for your solution. No rush. I developed for over a week with no tailwind styles being applied 🤣 |
You already have aliases in the config argument: alias: {
'@': '/Users/nn/Projects/Personal/ultrawideo-v3/src',
'~': '/Users/nn/Projects/Personal/ultrawideo-v3/src',
'@@': '/Users/nn/Projects/Personal/ultrawideo-v3',
'~~': '/Users/nn/Projects/Personal/ultrawideo-v3'
}, Identical to the ones from the {
find: '@',
replacement: '/Users/nn/Projects/Personal/ultrawideo-v3/src'
},
{
find: '~',
replacement: '/Users/nn/Projects/Personal/ultrawideo-v3/src'
},
{
find: '@@',
replacement: '/Users/nn/Projects/Personal/ultrawideo-v3'
},
{
find: '~~',
replacement: '/Users/nn/Projects/Personal/ultrawideo-v3'
}, So unless we also need those for something: {
find: 'webextension-polyfill',
replacement: '/Users/nn/Projects/Personal/ultrawideo-v3/browser.ts'
},
{
find: '@wxt/reload-html',
replacement: '/Users/nn/Projects/Personal/ultrawideo-v3/node_modules/wxt/dist/virtual/reload-html.js'
},
{
find: /^\/?@vite\/env/,
replacement: '/@fs/Users/nn/Projects/dvlden-wxt/node_modules/.pnpm/vite@5.0.12_@types+node@20.10.3_sass@1.69.5/node_modules/vite/dist/client/env.mjs'
},
{
find: /^\/?@vite\/client/,
replacement: '/@fs/Users/nn/Projects/dvlden-wxt/node_modules/.pnpm/vite@5.0.12_@types+node@20.10.3_sass@1.69.5/node_modules/vite/dist/client/client.mjs'
} I'll assume we can use |
Yeah, using InternalConfig.alias should be fine... If someone wants to add custom aliases, that's where they would add it. |
Describe the bug
It's like it suddenly stopped working and it became a really painful DX. I am not really certain when did this happen, but I've been developing some new features on another branch, with so much time waste and pain. Every time I make some style changes, I must restart WXT in order to see them. Reloading the extension does not work either. Previously, this behaviour was only when I made changes in entry file
popup/index.html
for example, but now it is happening in all files.To Reproduce
Will update issue once I figure out what the problem is.
Expected behavior
Should take effect once file is saved.
Video recording
wxt-tw.mp4
Environment
Additional context
I tested the TW example, saw it's broken, but HMR works. Going to fix the template and then hunt down why it isn't working for me anymore.
The text was updated successfully, but these errors were encountered: