Skip to content

Commit

Permalink
refactor: code (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
cap-Bernardito authored Aug 21, 2020
1 parent bfb75a7 commit aff77eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import os from 'os';
import crypto from 'crypto';

import { SourceMapConsumer } from 'source-map';
import { SourceMapSource, RawSource } from 'webpack-sources';
import RequestShortener from 'webpack/lib/RequestShortener';
import {
import webpack, {
ModuleFilenameHelpers,
SourceMapDevToolPlugin,
version as webpackVersion,
Expand All @@ -21,6 +20,11 @@ import { minify as minifyFn } from './minify';

const warningRegex = /\s.+:+([0-9]+):+([0-9]+)/;

// webpack 5 exposes the sources property to ensure the right version of webpack-sources is used
const { SourceMapSource, RawSource } =
// eslint-disable-next-line global-require
webpack.sources || require('webpack-sources');

class CssMinimizerPlugin {
constructor(options = {}) {
validateOptions(schema, options, {
Expand Down

0 comments on commit aff77eb

Please sign in to comment.