-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathoutput-dir.ts
More file actions
29 lines (26 loc) · 1.34 KB
/
output-dir.ts
File metadata and controls
29 lines (26 loc) · 1.34 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
28
29
import { getGlobalVariable } from '../../utils/env';
import { expectFileToExist } from '../../utils/fs';
import { expectGitToBeClean } from '../../utils/git';
import { ng } from '../../utils/process';
import { updateJsonFile } from '../../utils/project';
import { expectToFail } from '../../utils/utils';
export default function () {
// TODO(architect): Delete this test. It is now in devkit/build-angular.
const usingWebpack = !getGlobalVariable('argv')['esbuild'];
return ng('build', '--output-path', 'build-output', '--configuration=development')
.then(() => expectFileToExist(`./build-output/${usingWebpack ? '' : 'browser/'}index.html`))
.then(() => expectFileToExist(`./build-output/${usingWebpack ? '' : 'browser/'}main.js`))
.then(() => expectToFail(expectGitToBeClean))
.then(() =>
updateJsonFile('angular.json', (workspaceJson) => {
const appArchitect = workspaceJson.projects['test-project'].architect;
appArchitect.build.options.outputPath = 'config-build-output';
}),
)
.then(() => ng('build', '--configuration=development'))
.then(() =>
expectFileToExist(`./config-build-output/${usingWebpack ? '' : 'browser/'}index.html`),
)
.then(() => expectFileToExist(`./config-build-output/${usingWebpack ? '' : 'browser/'}main.js`))
.then(() => expectToFail(expectGitToBeClean));
}