Skip to content

Commit b96096e

Browse files
committed
.
1 parent 3a994f4 commit b96096e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import {
2+
writeMultipleFiles,
3+
deleteFile,
4+
expectFileToMatch,
5+
replaceInFile
6+
} from '../../../utils/fs';
7+
import { ng } from '../../../utils/process';
8+
import { stripIndents } from 'common-tags';
9+
import { updateJsonFile } from '../../../utils/project';
10+
import { expectToFail } from '../../../utils/utils';
11+
12+
export default function () {
13+
return writeMultipleFiles({
14+
'src/styles.scss': stripIndents`
15+
@import './imported-styles.scss';
16+
body { background-color: blue; }
17+
`,
18+
'src/imported-styles.scss': stripIndents`
19+
p { background-color: red; }
20+
`,
21+
'src/app/app.component.scss': stripIndents`
22+
.outer {
23+
.inner {
24+
background: #fff;
25+
}
26+
}
27+
`})
28+
.then(() => deleteFile('src/app/app.component.css'))
29+
.then(() => updateJsonFile('angular-cli.json', configJson => {
30+
const app = configJson['apps'][0];
31+
app['styles'] = ['styles.scss'];
32+
}))
33+
.then(() => replaceInFile('src/app/app.component.ts',
34+
'./app.component.css', './app.component.scss'))
35+
.then(() => ng('build'))
36+
.then(() => expectToFail(() => expectFileToMatch('dist/styles.bundle.css', /exports/)))
37+
.then(() => expectToFail(() => expectFileToMatch('dist/main.bundle.js',
38+
/".*module\.exports.*\.outer.*background:/)));
39+
}

0 commit comments

Comments
 (0)