File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ import os from 'os';
22import crypto from 'crypto' ;
33
44import { SourceMapConsumer } from 'source-map' ;
5- import { SourceMapSource , RawSource } from 'webpack-sources' ;
65import RequestShortener from 'webpack/lib/RequestShortener' ;
7- import {
6+ import webpack , {
87 ModuleFilenameHelpers ,
98 SourceMapDevToolPlugin ,
109 version as webpackVersion ,
@@ -21,6 +20,11 @@ import { minify as minifyFn } from './minify';
2120
2221const warningRegex = / \s .+ : + ( [ 0 - 9 ] + ) : + ( [ 0 - 9 ] + ) / ;
2322
23+ // webpack 5 exposes the sources property to ensure the right version of webpack-sources is used
24+ const { SourceMapSource, RawSource } =
25+ // eslint-disable-next-line global-require
26+ webpack . sources || require ( 'webpack-sources' ) ;
27+
2428class CssMinimizerPlugin {
2529 constructor ( options = { } ) {
2630 validateOptions ( schema , options , {
You can’t perform that action at this time.
0 commit comments