Skip to content

Commit d1037df

Browse files
authored
fix(ngtools/webpack): move the generate directory to a separate dir (#3256)
1 parent bf9c8f1 commit d1037df

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
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
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// Code generated by angular2-stress-test
1+
import {Component, ViewEncapsulation} from '@angular/core';
22

3-
import { Component } from '@angular/core';
43

54
@Component({
65
selector: 'app-root',
76
templateUrl: './app.component.html',
8-
styleUrls: ['./app.component.scss']
7+
styleUrls: ['./app.component.scss'],
8+
encapsulation: ViewEncapsulation.None
99
})
1010
export class AppComponent { }

tests/e2e/assets/webpack/test-app/app/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Code generated by angular2-stress-test
21
import { NgModule, Component } from '@angular/core';
32
import { BrowserModule } from '@angular/platform-browser';
43
import { RouterModule } from '@angular/router';

0 commit comments

Comments
 (0)