mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 20:02:40 +08:00
feat(@angular-devkit/build-angular): use evergreen version of zone.js with ES2015
This commit is contained in:
parent
e3a36c4d9f
commit
5b4b78bfbb
@ -95,7 +95,17 @@ export async function generateWebpackConfig(
|
||||
wco.buildOptions.progress = defaultProgress(wco.buildOptions.progress);
|
||||
|
||||
const partials = webpackPartialGenerator(wco);
|
||||
const webpackConfig = webpackMerge(partials);
|
||||
const webpackConfig = webpackMerge(partials) as webpack.Configuration;
|
||||
|
||||
if (supportES2015) {
|
||||
if (!webpackConfig.resolve) {
|
||||
webpackConfig.resolve = {};
|
||||
}
|
||||
if (!webpackConfig.resolve.alias) {
|
||||
webpackConfig.resolve.alias = {};
|
||||
}
|
||||
webpackConfig.resolve.alias['zone.js/dist/zone'] = 'zone.js/dist/zone-evergreen';
|
||||
}
|
||||
|
||||
if (options.profile || process.env['NG_BUILD_PROFILING']) {
|
||||
const esVersionInFileName = getEsVersionForFileName(
|
||||
|
@ -98,4 +98,13 @@ describe('Browser Builder with differential loading', () => {
|
||||
expect(await files['main-es5.js']).not.toContain('class');
|
||||
expect(await files['main-es2015.js']).toContain('class');
|
||||
});
|
||||
|
||||
it('uses the right zone.js variant', async () => {
|
||||
const { files } = await browserBuild(architect, host, target, { optimization: false });
|
||||
expect(await files['polyfills-es5.js']).toContain('zone.js/dist/zone');
|
||||
expect(await files['polyfills-es5.js']).not.toContain('zone.js/dist/zone-evergreen');
|
||||
expect(await files['polyfills-es5.js']).toContain('registerElementPatch');
|
||||
expect(await files['polyfills-es2015.js']).toContain('zone.js/dist/zone-evergreen');
|
||||
expect(await files['polyfills-es2015.js']).not.toContain('registerElementPatch');
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user