Skip to content

Commit

Permalink
fix: get rid deprecation warnings for webpack@5 (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Oct 22, 2019
1 parent cd80227 commit 0e9b780
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.js
Expand Up @@ -7,7 +7,7 @@ import RequestShortener from 'webpack/lib/RequestShortener';
import {
ModuleFilenameHelpers,
SourceMapDevToolPlugin,
JavascriptModulesPlugin,
javascript,
} from 'webpack';
import validateOptions from 'schema-utils';
import serialize from 'serialize-javascript';
Expand Down Expand Up @@ -522,8 +522,10 @@ class TerserPlugin {
});
}

if (JavascriptModulesPlugin) {
const hooks = JavascriptModulesPlugin.getCompilationHooks(compilation);
if (javascript && javascript.JavascriptModulesPlugin) {
const hooks = javascript.JavascriptModulesPlugin.getCompilationHooks(
compilation
);
const data = serialize({
terser: terserPackageJson.version,
terserOptions: this.options.terserOptions,
Expand Down

0 comments on commit 0e9b780

Please sign in to comment.