-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathsymlinked-global.ts
More file actions
27 lines (22 loc) · 1.14 KB
/
symlinked-global.ts
File metadata and controls
27 lines (22 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { symlinkSync } from 'node:fs';
import { resolve } from 'node:path';
import { expectFileToMatch, writeMultipleFiles } from '../../../utils/fs';
import { ng } from '../../../utils/process';
import { updateJsonFile } from '../../../utils/project';
export default async function () {
await writeMultipleFiles({
'src/styles.scss': `p { color: red }`,
'src/styles-for-link.scss': `p { color: blue }`,
});
symlinkSync(resolve('src/styles-for-link.scss'), resolve('src/styles-linked.scss'));
await updateJsonFile('angular.json', (workspaceJson) => {
const appArchitect = workspaceJson.projects['test-project'].architect;
appArchitect.build.options.styles = ['src/styles.scss', 'src/styles-linked.scss'];
});
await ng('build', '--configuration=development');
await expectFileToMatch('dist/test-project/browser/styles.css', 'red');
await expectFileToMatch('dist/test-project/browser/styles.css', 'blue');
await ng('build', '--preserve-symlinks', '--configuration=development');
await expectFileToMatch('dist/test-project/browser/styles.css', 'red');
await expectFileToMatch('dist/test-project/browser/styles.css', 'blue');
}