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: pcss in manifest.json saved as css (fixed #12009) #12030

Closed

Conversation

faga295
Copy link

@faga295 faga295 commented Feb 12, 2023

closed #12009

Description

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bluwy bluwy added feat: css p3-minor-bug An edge case that only affects very specific usage (priority) labels Feb 13, 2023
@bluwy
Copy link
Member

bluwy commented Feb 14, 2023

/ecosystem-ci run

@vite-ecosystem-ci

This comment was marked as outdated.

@bluwy
Copy link
Member

bluwy commented Feb 14, 2023

Hmm vite-plugin-ssr seems to be consistently failing with this pr. @brillout maybe you have some ideas why it's happening here. (Note: vite-setup-catalogue is currently failing in main too)

@brillout
Copy link
Contributor

VPS expects all style entries to end with .css, AFAICT rightful so. At least, I certainly don't expect PostCSS files to exist in dist/client/. Therefore I'd argue that all style files should end with .css.

@bluwy
Copy link
Member

bluwy commented Feb 14, 2023

IIUC the output would still be .css. This PR fixes the case when the src in the manifest file points wrongly to, for example, src/style.css instead of src/style.pcss, where the latter is the actual existing file. Is vite-plugin-ssr using the src for something?

@brillout
Copy link
Contributor

VPS doesn't use the src property, so it seems like this PR has some side effects? @faga295

@faga295
Copy link
Author

faga295 commented Feb 14, 2023

Probably, maybe the assets originName has other uses

@brillout
Copy link
Contributor

@faga295 I would $ diff manifest.json pre/post-PR and see what changes. Chances that you'll see the unwanted side effects right away. (VPS can't find assets post-PR.)

@faga295
Copy link
Author

faga295 commented Feb 14, 2023

nice~this will help a lot

@brillout
Copy link
Contributor

brillout commented Feb 14, 2023 via email

@faga295
Copy link
Author

faga295 commented Feb 15, 2023

Seems the originalName of assets chunk only used in generating manifest.json.I really can't think of any other side effects.

@bluwy
Copy link
Member

bluwy commented Feb 18, 2023

@brillout I'm pretty sure this PR doesn't introduce any unwanted change in the manifest, and only changes what's outlined at #12009 (comment). The originalName change in this PR is only used in a few places. I'll run vite-plugin-ssr's test suite again just in case, but this PR looks safe to me.

@bluwy
Copy link
Member

bluwy commented Feb 18, 2023

/ecosystem-ci run vite-plugin-ssr

@vite-ecosystem-ci

This comment was marked as outdated.

@bluwy
Copy link
Member

bluwy commented Feb 18, 2023

Looks like it's still failing at https:/brillout/vite-plugin-ssr/blob/e0e96a570a2cc2ded9041fe40d4c68d0a99c7edb/vite-plugin-ssr/node/runtime/renderPage/getPageAssets/getManifestEntry.ts#L44, seems like it's indexing using the manifestKeyMap but this PR makes the index undefined? The getManifestKeyMap doesn't look out of the ordinary to me.

@brillout
Copy link
Contributor

(@bluwy FYI brillout@5af52d1.)

@faga295
Copy link
Author

faga295 commented Feb 19, 2023

Indeed, I debug it and I realized that cssAssetName is not always a cssRequest, such as index.html, so the originalName should be cssFileName instead of cssAssetName

@bluwy
Copy link
Member

bluwy commented Feb 20, 2023

Thanks for helping to check that 🙂 Didn't expect a html file in the CSS plugin. I'll tweak the code a bit and run ecosystem-ci again.

@bluwy
Copy link
Member

bluwy commented Feb 20, 2023

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Feb 20, 2023

📝 Ran ecosystem CI: Open

suite result
astro ✅ success
histoire ✅ success
iles ✅ success
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt-framework ✅ success
previewjs ✅ success
qwik ⏹️ cancelled
rakkas ✅ success
sveltekit ✅ success
vite-plugin-ssr ❌ failure
vite-plugin-react ✅ success
vite-plugin-react-pages ❌ failure
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ✅ success
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ✅ success
windicss ✅ success

@faga295
Copy link
Author

faga295 commented Feb 21, 2023

Seems it still has some problems.

@faga295
Copy link
Author

faga295 commented Feb 21, 2023

I think we should discuss the standard of the src of manifest.json, because sometimes the ?used query(maybe more other query) will occur in src, I think it's not a expect result.
image
this is a snapshot of manifest.json built in main branch

@faga295
Copy link
Author

faga295 commented Feb 21, 2023

the simplest solution of this issue is add .pcss, .postcss, sss based on ispreprocessor, but not include css.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: css p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If .pcss is specified, the src in the manifest.json file will be saved as .css
4 participants