File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable class-methods-use-this */
22
3- import webpack , { version as webpackVersion } from 'webpack' ;
3+ import webpack from 'webpack' ;
44
55import { validate } from 'schema-utils' ;
66
@@ -103,7 +103,9 @@ class MiniCssExtractPlugin {
103103
104104 /** @param {import("webpack").Compiler } compiler */
105105 apply ( compiler ) {
106- const isWebpack4 = compiler . webpack ? false : webpackVersion [ 0 ] === '4' ;
106+ const isWebpack4 = compiler . webpack
107+ ? false
108+ : typeof compiler . resolvers !== 'undefined' ;
107109
108110 if ( ! isWebpack4 ) {
109111 const { splitChunks } = compiler . options . optimization ;
Original file line number Diff line number Diff line change 11import path from 'path' ;
22
33import loaderUtils from 'loader-utils' ;
4- import { version as webpackVersion } from 'webpack' ;
54import NodeTemplatePlugin from 'webpack/lib/node/NodeTemplatePlugin' ;
65import NodeTargetPlugin from 'webpack/lib/node/NodeTargetPlugin' ;
76import LibraryTemplatePlugin from 'webpack/lib/LibraryTemplatePlugin' ;
@@ -103,7 +102,9 @@ export function pitch(request) {
103102
104103 let source ;
105104
106- const isWebpack4 = childCompiler . webpack ? false : webpackVersion [ 0 ] === '4' ;
105+ const isWebpack4 = childCompiler . webpack
106+ ? false
107+ : typeof childCompiler . resolvers !== 'undefined' ;
107108
108109 if ( isWebpack4 ) {
109110 childCompiler . hooks . afterCompile . tap ( pluginName , ( compilation ) => {
You can’t perform that action at this time.
0 commit comments