Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): fix webpack 5 deprecation warning…
Browse files Browse the repository at this point in the history
… for chunk.push
  • Loading branch information
valorkin authored and alan-agius4 committed Sep 29, 2020
1 parent 5e293f0 commit d74e7e3
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -12,6 +12,7 @@ import { Compiler, loader } from 'webpack';
import { CachedSource, ConcatSource, OriginalSource, RawSource, Source } from 'webpack-sources';
import { interpolateName } from 'loader-utils';
import * as path from 'path';
import { isWebpackFiveOrHigher } from '../../utils/webpack-version';

const Chunk = require('webpack/lib/Chunk');
const EntryPoint = require('webpack/lib/Entrypoint');
Expand Down Expand Up @@ -72,7 +73,11 @@ export class ScriptsWebpackPlugin {
chunk.rendered = !cached;
chunk.id = this.options.name;
chunk.ids = [chunk.id];
chunk.files.push(filename);
if (isWebpackFiveOrHigher()) {
chunk.files.add(filename);
} else {
chunk.files.push(filename);
}

const entrypoint = new EntryPoint(this.options.name);
entrypoint.pushChunk(chunk);
Expand Down

0 comments on commit d74e7e3

Please sign in to comment.