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: allow importing .css and assets inside node_modules #3873

Conversation

sheremet-va
Copy link
Member

Description

Fixes #3862

New --experimental-vm-threads allows us to process .css files and assets inside Node.js modules without manually inlining them. We can give better performance inside this pool by enabling CSS and asset processing without asking people to manually inline the whole library.

Unfortunately, other pools cannot support this until Node.js loader is standardized (the development is very fast, we can't keep up with the changes to be honest).

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@stackblitz
Copy link

stackblitz bot commented Aug 3, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Aug 3, 2023

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit b41977a
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/64cb5d78a460ee0008ecb7d7

@sheremet-va sheremet-va closed this Aug 3, 2023
@dimitur2204
Copy link

dimitur2204 commented Feb 1, 2024

I am running into that exact problem I believe. Is there something I can do to enable that importing?
image

The vitest version I have is 1.2.2

@dimitur2204
Copy link

I am running into that exact problem I believe. Is there something I can do to enable that importing? image

The vitest version I have is 1.2.2

I managed to resolve the problem by including the pool: vmThreads option on the test object. I'm assuming this is the reason this PR was closed in the first place.

@sheremet-va sheremet-va deleted the fix/allow-importing-css-inside-libs branch February 1, 2024 10:52
@sheremet-va
Copy link
Member Author

It was closed because the actual implementation is in #3880

@vitest-dev vitest-dev locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERR_UNKNOWN_FILE_EXTENSION with css inside dependency
2 participants