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

fix/tw-classnames-output-#627 #654

Merged
merged 4 commits into from
Aug 18, 2024
Merged

Conversation

PatrykKuniczak
Copy link
Collaborator

@PatrykKuniczak PatrykKuniczak commented Aug 13, 2024

* Please fill in the required items.

Priority*

  • High: This PR needs to be merged first for other tasks.
  • Middle: This PR should be merged quickly to prevent conflicts due to common changes. (default)
  • Low: This PR does not affect other tasks, so it can be merged later.

Purpose of the PR*

I can't open PR to fork, that's why i created this PR.

This is related to #627.

I fixed that fix :)

Solution from #627 wasn't good enough because of the never ending build and it's still don't work properly.

Changes*

I added concurrently for run both watch scripts on the same time, now it was running independly.

Without that, only first script works.
If i placed vite first then tailwind output file wasn't regenerated.
Else Vite don't run and HMR don't refresh page.

I added also -m flag, for minify output file.

And i added dist folder inside content-ui

How to check the feature

Edit files from content-ui page.

@codergigachad
Copy link
Contributor

My solution was a beginner solution, thanks for fixing it like an expert.

@PatrykKuniczak
Copy link
Collaborator Author

My solution was a beginner solution, thanks for fixing it like an expert.

Thanks, but i don't feel like an expert.

You've found that issue, which we're not aware, that's also very helpful 😄

Copy link
Owner

@Jonghakseo Jonghakseo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

"build:tailwindcss": "tailwindcss -i src/tailwind-input.css -o src/tailwind-output.css",
"build": "pnpm run clean && pnpm type-check && pnpm build:tailwindcss && vite build",
"build:watch": "cross-env __DEV__=true vite build --mode development & pnpm build:tailwindcss -- --watch",
"build:tailwindcss": "pnpm dlx tailwindcss -i ./src/tailwind-input.css -o ./dist/tailwind-output.css -m",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스크린샷 2024-08-14 오후 8 45 29

I saw above error message. How about moving it inside src, the original file's location, instead of the dist folder?

Is there a reason you moved the output file to dist?

Suggested change
"build:tailwindcss": "pnpm dlx tailwindcss -i ./src/tailwind-input.css -o ./dist/tailwind-output.css -m",
"build:tailwindcss": "pnpm dlx tailwindcss -i ./src/tailwind-input.css -o ./src/tailwind-output.css -m",

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jonghakseo I want to separate output file from src, and there's entire /dist ignored.

Copy link
Owner

@Jonghakseo Jonghakseo Aug 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the PR above, It seems like a good idea to exclude from VSC for output files.
How about moving it inside src and out of vsc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jonghakseo What do you mean about 'out of vsc'?

Copy link
Collaborator Author

@PatrykKuniczak PatrykKuniczak Aug 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That bug occur probably because of the lack of &
In build-watch script:
development & pnpm build:tailwindcss

Not it's done by concurrently

And i check it a minute ago on VSC, and works perfect, postinstall isn't necessary.

Copy link
Owner

@Jonghakseo Jonghakseo Aug 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스크린샷 2024-08-18 오후 2 18 38

For me, I still see the above error message.
I just run pnpm dev after pnpm clean and I can see it right after.

@PatrykKuniczak

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jonghakseo Yeah, that's reproducible, i need to fix it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jonghakseo Ok, I added a tw prebuild before, postinstall can't solve that issue, but this kind of prebuild did it.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna check it!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HMR was not working. so i fixed it.

fix: use dev env

// @ts-ignore
import tailwindcssOutput from '@src/tailwind-output.css?inline';
// @ts-expect-error That's because output file is create during build
import tailwindcssOutput from '../dist/tailwind-output.css?inline';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import tailwindcssOutput from '../dist/tailwind-output.css?inline';
import tailwindcssOutput from '@src/tailwind-output.css?inline';

This is related to the comment above.

@PatrykKuniczak PatrykKuniczak force-pushed the fix/tw-classnames-output-#627 branch from 5c52da6 to 7928ee4 Compare August 17, 2024 10:20
@codergigachad
Copy link
Contributor

@PatrykKuniczak any progress here? cause this is very important.

@PatrykKuniczak
Copy link
Collaborator Author

@PatrykKuniczak any progress here? cause this is very important.

We're waiting for @Jonghakseo review

@PatrykKuniczak
Copy link
Collaborator Author

@codergigachad OO maybe he done review, before my message, i'm on mobile then and don't see all messages :)

I will take a look to merge it today.

codergigachad and others added 2 commits August 18, 2024 08:56
Tailwind build was not working in content-ui during hmr due to syntax error.
@PatrykKuniczak PatrykKuniczak force-pushed the fix/tw-classnames-output-#627 branch from 7928ee4 to 9091b12 Compare August 18, 2024 06:56
@PatrykKuniczak
Copy link
Collaborator Author

@Jonghakseo I belived i had to check, because i was thinking if this env will be resolved properly.

Good to you, thank for the second check ❤️

@PatrykKuniczak PatrykKuniczak merged commit be1c3e0 into main Aug 18, 2024
4 checks passed
@PatrykKuniczak PatrykKuniczak deleted the fix/tw-classnames-output-#627 branch August 18, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants