Repository navigation
Skip modules that mention ecij without importing from it - #134
Merged
Merged
Conversation
The code filter of `transform` matched any module containing "ecij", so modules that only mention it, like ecij's own `index.js` outside of `node_modules`, were parsed for nothing. It now matches named imports from ecij, the only way to import `css`, with or without spaces, as minified code has none. Vitest's cache opt-out uses the same pattern. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
codefilter oftransformmatched any module that contains "ecij", so modules that only mention it were parsed for nothing:index.js, whose error message names the plugin, wherever it is not undernode_modules, like in linked or workspace setups and in this repository's teststest/fixtures/barrel.ts, which imports./no-ecij.inputtest/fixtures/no-ecij.input.ts, whose first comment mentions ecijThe filter now matches named imports from ecij, the only way to import
css:ECIJ_IMPORT_REGEX = /\}\s*from\s*["']ecij["']/. It allows imports without spaces, likeimport{css}from"ecij"in minified code. Requiring spaces would skip those modules and leavecssto throw at runtime. Rolldown evaluates the filter natively. Vitest's cache opt-out inconfigureVitestuses the same pattern, so modules that only mention ecij stay in its cache.The only form it misses is a comment between the closing brace and
from, likeimport { css } /* … */ from 'ecij'.Verification
main, and only the modules that import from ecij on this branch.extract CSS from modules that import css without spaces, like minified ones, builds a.jsfixture, as Vite reprints TypeScript before the plugin runs, and// oxfmt-ignorekeeps its import compact. It fails when the pattern requires spaces.index.jsundernode_modules, so this is about precision more than speed.Coverage is unchanged.
🤖 Generated with Claude Code