Skip to content

Commit 6bb0c78

Browse files
FrozenPandazhansl
authored andcommitted
fix(@schematics/angular): fix styles field of angular.json in application schematic
1 parent fe12251 commit 6bb0c78

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, workspace: Workspace
202202
tsConfig: `${rootFilesRoot}tsconfig.spec.json`,
203203
karmaConfig: `${rootFilesRoot}karma.conf.js`,
204204
styles: [
205-
`${projectRoot}styles.${options.style}`,
205+
`${projectRoot}src/styles.${options.style}`,
206206
],
207207
scripts: [],
208208
assets: [

packages/schematics/angular/application/index_spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ describe('Application Schematic', () => {
212212
expect(buildOpt.main).toEqual('src/main.ts');
213213
expect(buildOpt.polyfills).toEqual('src/polyfills.ts');
214214
expect(buildOpt.tsConfig).toEqual('src/tsconfig.app.json');
215+
216+
const testOpt = prj.architect.test.options;
217+
expect(testOpt.main).toEqual('src/test.ts');
218+
expect(testOpt.tsConfig).toEqual('src/tsconfig.spec.json');
219+
expect(testOpt.karmaConfig).toEqual('src/karma.conf.js');
220+
expect(testOpt.styles).toEqual([
221+
'src/styles.css',
222+
]);
215223
});
216224

217225
it('should set the relative tsconfig paths', () => {

0 commit comments

Comments
 (0)