You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visitors can return a new value to update it. Each visitor accepts a different type of value, and usually expects the same type in return. This example multiplies all lengths by 2:
So, if I’m writing visitor for url(), this is what I have:
constvisitor={Url({ url, loc }){if(url.includes("foo")){return{ loc,url: url.replace("foo","foofoo")};}},};
Is this the right approach for this?
Do I need to do anything with the loc property, or should I just pass it as-is?
I’m asking because I don’t know if this has any relation to other processes after LightningCSS, e.g. source map mappings.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the documentation it says the following:
So, if I’m writing visitor for
url(), this is what I have:Is this the right approach for this?
Do I need to do anything with the
locproperty, or should I just pass it as-is?I’m asking because I don’t know if this has any relation to other processes after LightningCSS, e.g. source map mappings.
Beta Was this translation helpful? Give feedback.
All reactions