-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add size check of new project production build
- Loading branch information
Showing
4 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import {ng} from '../../utils/process'; | ||
import {expectFileToMatch} from '../../utils/fs'; | ||
|
||
export default function() { | ||
return ng('build') | ||
.then(() => expectFileToMatch('dist/test-project/index.html', 'main.js')) | ||
.then(() => ng('build', '--prod')) | ||
.then(() => expectFileToMatch('dist/test-project/index.html', /main\.[a-zA-Z0-9]{20}\.js/)); | ||
import { expectFileToMatch, moveDirectory } from '../../utils/fs'; | ||
import { ng } from '../../utils/process'; | ||
|
||
|
||
export default async function() { | ||
// Development build | ||
await ng('build'); | ||
await expectFileToMatch('dist/test-project/index.html', 'main.js'); | ||
|
||
|
||
// Production build | ||
await ng('build', '--prod'); | ||
await expectFileToMatch('dist/test-project/index.html', /main\.[a-zA-Z0-9]{20}\.js/); | ||
|
||
// Store the production build for artifact storage on CircleCI | ||
if (process.env['CIRCLECI']) { | ||
await ng('build', '--prod', '--output-hashing=none'); | ||
await moveDirectory('dist', '~/temp-dist'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters