Skip to content

Commit

Permalink
fix(ngtools/webpack): move the generate directory to a separate dir (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl authored Nov 29, 2016
1 parent bf9c8f1 commit d1037df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/webpack/src/reflector_host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function patchReflectorHost(codeGenerator: CodeGenerator) {
reflectorHost.getImportPath = function(containingFile: string, importedFile: string): string {
// Hack together SCSS and LESS files URLs so that they match what the default ReflectorHost
// is expected. We only do that for shimmed styles.
const m = importedFile.match(/(.*)(\..+)(\.shim)(\..+)/);
const m = importedFile.match(/(.*)(\.css|\.scss|\.less|\.stylus)((?:\.shim)?)(\..+)/);
if (!m) {
return oldGIP.call(this, containingFile, importedFile);
}
Expand All @@ -21,6 +21,6 @@ export function patchReflectorHost(codeGenerator: CodeGenerator) {
const [, baseDirAndName, styleExt, shim, ext] = m;
const result = oldGIP.call(this, containingFile, baseDirAndName + '.css' + shim + ext);

return result.replace(/\.css\./, styleExt + '.');
return result.replace(/\.css($|\.)/, styleExt + '$1');
};
}
6 changes: 3 additions & 3 deletions tests/e2e/assets/webpack/test-app/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Code generated by angular2-stress-test
import {Component, ViewEncapsulation} from '@angular/core';

import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
styleUrls: ['./app.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class AppComponent { }
1 change: 0 additions & 1 deletion tests/e2e/assets/webpack/test-app/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Code generated by angular2-stress-test
import { NgModule, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
Expand Down

0 comments on commit d1037df

Please sign in to comment.