We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d94040b commit f2ff1a4Copy full SHA for f2ff1a4
packages/@ngtools/webpack/src/loader.ts
@@ -262,8 +262,11 @@ function _removeModuleId(refactor: TypeScriptFileRefactor) {
262
263
function _getResourceRequest(element: ts.Expression, sourceFile: ts.SourceFile) {
264
if (element.kind == ts.SyntaxKind.StringLiteral) {
265
- // if string, assume relative path unless it start with /
266
- return `'${loaderUtils.urlToRequest((element as ts.StringLiteral).text, '')}'`;
+ const url = (element as ts.StringLiteral).text;
+ if (url[0] == '.') {
267
+ return `'${url}'`;
268
+ }
269
+ return `'./${url}'`;
270
} else {
271
// if not string, just use expression directly
272
return element.getFullText(sourceFile);
0 commit comments