chore: update es-module-lexer to 2.0.0#22288
chore: update es-module-lexer to 2.0.0#22288nicolo-ribaudo wants to merge 1 commit intovitejs:mainfrom
es-module-lexer to 2.0.0#22288Conversation
e8be27d to
5ed1677
Compare
es-module-lexer to 2.0.0es-module-lexer to 2.0.0
|
We read the attribute location in one place: vite/packages/vite/src/node/plugins/importAnalysis.ts Lines 523 to 526 in 40a0847 IIUC |
|
Oh I see, I was confused because I agree that probably nobody uses if(!isDynamicImport) {
if (attributeIndex > -1) {
str().remove(end + 1, expEnd)
} else {
const re = /\s*assert\b/y;
re.lastIndex = expEnd;
if (re.test(source)) {
str().remove(end + 1, source.indexOf('}', expEnd) + 1)
}
}Fyi I'm hoping that after this 2.0.0 update we can later update to 2.0.1 once it's released: right now there is a bug in |
|
I think I'm slightly inclined on not adding the compat since it'll run the regex on every normal imports otherwise, which could have some performance implication. But I'll see what others think of this, maybe it's fine for now and then we can drop it in the next minor. I'll mark this for the next minor milestone for now so we track this. |
While investigating #16678, I spent some time checking what were the breaking changes in
es-module-lexer@2.0.0and how they affect Vite.The only breaking change is that it switched from parsing import assertions (
import ... assert {}) to parsing import attributes (import ... with {}): this does not affect Vite in any way, because Vite does not usees-module-lexerto read attributes.This PR is effectively a no-op, but I'm opening it so that somebody else won't have to investigate again whether 2.0.0 contains breaking changes or not.