Skip to content

Commit

Permalink
fix(schematics): correct 'bootstrap/scss/bootstrap' imports (#4465)
Browse files Browse the repository at this point in the history
Removes tilda from the import

Fixes #4463
  • Loading branch information
maxokorokov committed Jan 9, 2023
1 parent 54bf804 commit 56b166b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions schematics/ng-add/setup-project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ import { createTestApp } from '../utils/testing';
const expectedStylesPath = `projects/${projectName}/src/styles.sass`;
const stylesFile = tree.read(expectedStylesPath)!.toString();

expect(stylesFile).toContain(`@import '~bootstrap/scss/bootstrap'`);
expect(stylesFile).not.toContain(`@import '~bootstrap/scss/bootstrap;'`);
expect(stylesFile).toContain(`@import 'bootstrap/scss/bootstrap'`);
expect(stylesFile).not.toContain(`@import 'bootstrap/scss/bootstrap;'`);
});

it(`should patch 'style.scss' when using SCSS styles`, async () => {
Expand All @@ -63,7 +63,7 @@ import { createTestApp } from '../utils/testing';
const expectedStylesPath = `projects/${projectName}/src/styles.scss`;
const stylesFile = tree.read(expectedStylesPath)!.toString();

expect(stylesFile).toContain(`@import '~bootstrap/scss/bootstrap';`);
expect(stylesFile).toContain(`@import 'bootstrap/scss/bootstrap';`);
});

it(`should add 'bootstrap.min.css' to 'angular.json' if style system is unsupported`, async () => {
Expand Down
4 changes: 2 additions & 2 deletions schematics/ng-add/steps/add-bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const BOOTSTRAP_CSS_FILEPATH = 'node_modules/bootstrap/dist/css/bootstrap.min.cs
const SUPPORTED_BOOTSTRAP_STYLE_IMPORTS = {
'.sass': `
/* Importing Bootstrap SCSS file. */
@import '~bootstrap/scss/bootstrap'
@import 'bootstrap/scss/bootstrap'
`,
'.scss': `
/* Importing Bootstrap SCSS file. */
@import '~bootstrap/scss/bootstrap';
@import 'bootstrap/scss/bootstrap';
`,
};

Expand Down

0 comments on commit 56b166b

Please sign in to comment.