Skip to content

Commit 1acf4e4

Browse files
committed
fix(ngtools/webpack): move the generate directory to a separate dir
1 parent f9a7c01 commit 1acf4e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/webpack/src/reflector_host.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function patchReflectorHost(codeGenerator: CodeGenerator) {
1111
reflectorHost.getImportPath = function(containingFile: string, importedFile: string): string {
1212
// Hack together SCSS and LESS files URLs so that they match what the default ReflectorHost
1313
// is expected. We only do that for shimmed styles.
14-
const m = importedFile.match(/(.*)(\..+)(\.shim)(\..+)/);
14+
const m = importedFile.match(/(.*)(\.css|\.scss|\.less|\.stylus)((?:\.shim)?)(\..+)/);
1515
if (!m) {
1616
return oldGIP.call(this, containingFile, importedFile);
1717
}
@@ -21,6 +21,6 @@ export function patchReflectorHost(codeGenerator: CodeGenerator) {
2121
const [, baseDirAndName, styleExt, shim, ext] = m;
2222
const result = oldGIP.call(this, containingFile, baseDirAndName + '.css' + shim + ext);
2323

24-
return result.replace(/\.css\./, styleExt + '.');
24+
return result.replace(/\.css($|\.)/, styleExt + '$1');
2525
};
2626
}

0 commit comments

Comments
 (0)