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
Angular CLI used to transform this code pattern with a url pointing build destination directory so it works properly after build. But after updating to 13.1, it only transforms import.meta.url part to file: protocol url.
I'm not sure this is considered as implementation detail from webpack, but syntaxes used in the code is all from web standard and it is working properly without transformation(Angular CLI build process), so I think it should be supported by Angular CLI.
Seems this commit moved configs disabling url/worker parsing from server config to common config which causes the issue.
log2-hwan
changed the title
new URL('...', import.meta.url) pattern with SVG files isn't processed properly by Angular CLI
new URL('...', import.meta.url) pattern isn't processed properly by Angular CLI
Dec 16, 2021
Previously, new URL caused Webpack's assets modules to be enabled by default. This is a Webpack specific feature which is not supported. See #22351 for more context.
import.meta.url is indeed a web standard, however Webpack will always replace import.meta.url to a static string with file:// which makes using this at runtime a non viable. see: webpack/webpack#14809.
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: 13.0.4
Description
Angular CLI used to transform this code pattern with a url pointing build destination directory so it works properly after build. But after updating to 13.1, it only transforms
import.meta.url
part tofile:
protocol url.I'm not sure this is considered as implementation detail from webpack, but syntaxes used in the code is all from web standard and it is working properly without transformation(Angular CLI build process), so I think it should be supported by Angular CLI.
🔬 Minimal Reproduction
https://github.com/log2-hwan/angular-cli-svg-url-bug
🔥 Exception or Error
Wrong url in output js bundle
🌍 Your Environment
The text was updated successfully, but these errors were encountered: