File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable class-methods-use-this */
2
2
3
- import webpack , { version as webpackVersion } from 'webpack' ;
3
+ import webpack from 'webpack' ;
4
4
5
5
import { validate } from 'schema-utils' ;
6
6
@@ -103,7 +103,9 @@ class MiniCssExtractPlugin {
103
103
104
104
/** @param {import("webpack").Compiler } compiler */
105
105
apply ( compiler ) {
106
- const isWebpack4 = compiler . webpack ? false : webpackVersion [ 0 ] === '4' ;
106
+ const isWebpack4 = compiler . webpack
107
+ ? false
108
+ : typeof compiler . resolvers !== 'undefined' ;
107
109
108
110
if ( ! isWebpack4 ) {
109
111
const { splitChunks } = compiler . options . optimization ;
Original file line number Diff line number Diff line change 1
1
import path from 'path' ;
2
2
3
3
import loaderUtils from 'loader-utils' ;
4
- import { version as webpackVersion } from 'webpack' ;
5
4
import NodeTemplatePlugin from 'webpack/lib/node/NodeTemplatePlugin' ;
6
5
import NodeTargetPlugin from 'webpack/lib/node/NodeTargetPlugin' ;
7
6
import LibraryTemplatePlugin from 'webpack/lib/LibraryTemplatePlugin' ;
@@ -103,7 +102,9 @@ export function pitch(request) {
103
102
104
103
let source ;
105
104
106
- const isWebpack4 = childCompiler . webpack ? false : webpackVersion [ 0 ] === '4' ;
105
+ const isWebpack4 = childCompiler . webpack
106
+ ? false
107
+ : typeof childCompiler . resolvers !== 'undefined' ;
107
108
108
109
if ( isWebpack4 ) {
109
110
childCompiler . hooks . afterCompile . tap ( pluginName , ( compilation ) => {
You can’t perform that action at this time.
0 commit comments