-
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.
fix(@angular-devkit/build-angular): ignore bundle budgets when runnin…
…g karma or devserver Fixes #14100
- Loading branch information
Showing
4 changed files
with
42 additions
and
4 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
35 changes: 35 additions & 0 deletions
35
packages/angular_devkit/build_angular/test/dev-server/budgets_spec_large.ts
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
import { normalize, virtualFs } from '@angular-devkit/core'; | ||
import { createArchitect, host } from '../utils'; | ||
|
||
describe('Dev Server Builder bundle budgets', () => { | ||
const targetSpec = { project: 'app', target: 'serve' }; | ||
|
||
beforeEach(async () => host.initialize().toPromise()); | ||
afterEach(async () => host.restore().toPromise()); | ||
|
||
it('should ignore budgets', async () => { | ||
const config = host.scopedSync().read(normalize('angular.json')); | ||
const jsonConfig = JSON.parse(virtualFs.fileBufferToString(config)); | ||
const buildOptions = jsonConfig.projects.app.targets.build.options; | ||
|
||
buildOptions.budgets = [{ type: 'all', maximumError: '100b' }], | ||
buildOptions.optimization = true; | ||
|
||
host.writeMultipleFiles({ | ||
'angular.json': JSON.stringify(jsonConfig), | ||
}); | ||
|
||
const architect = (await createArchitect(host.root())).architect; | ||
const run = await architect.scheduleTarget(targetSpec); | ||
const output = await run.result; | ||
expect(output.success).toBe(true); | ||
await run.stop(); | ||
}); | ||
}); |
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