Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): explicitly set compilation target…
Browse files Browse the repository at this point in the history
… in test configuration

When not set, and browserslist returns no reesults due to the file being empty or commented. Webpack will generate invalid code because it doesn't know which enviorment we want to target.

```diff
- (self["webpackChunktest_app"] = self["webpackChunktest_app"] || []).push([["vendor"],{

/***/ 8583:
```

Closes #21111
  • Loading branch information
alan-agius4 authored and clydin committed Jun 11, 2021
1 parent 071c8d1 commit 8360251
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -8,6 +8,7 @@

import * as glob from 'glob';
import * as path from 'path';
import { ScriptTarget } from 'typescript';
import * as webpack from 'webpack';
import { WebpackConfigOptions, WebpackTestOptions } from '../../utils/build-options';
import { getSourceMapDevTool, isPolyfillsEntry } from '../utils/helpers';
Expand Down Expand Up @@ -51,6 +52,7 @@ export function getTestConfig(

return {
mode: 'development',
target: wco.tsConfig.options.target === ScriptTarget.ES5 ? ['web', 'es5'] : 'web',
resolve: {
mainFields: ['es2015', 'browser', 'module', 'main'],
},
Expand Down

0 comments on commit 8360251

Please sign in to comment.