Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Don't pass removed minimize option to CSS Loader #294

Merged
merged 1 commit into from Nov 7, 2018

Conversation

ocean90
Copy link
Contributor

@ocean90 ocean90 commented Sep 28, 2018

The option has been removed in version 1.0, see webpack-contrib/css-loader@965068d.

Fixes #286.

@timneutkens
Copy link
Member

Should a minimizer be implemented?

@kylemh
Copy link
Contributor

kylemh commented Oct 1, 2018

It appears as though the css-loader author encourages you to leverage cssnano via postcss or webpack to minify:

https://github.com/webpack-contrib/css-loader/releases/tag/v1.0.0

@timneutkens timneutkens merged commit 6bbf72d into vercel:master Nov 7, 2018
@eeyang92
Copy link

eeyang92 commented Dec 19, 2018

Hi, I'm using @zeit/next-less and I'm running into an issue where even the presence of minimized: false triggers an exception:

./node_modules/antd/lib/input/style/index.less
Module build failed (from ./node_modules/@zeit/next-css/node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/css-loader/dist/cjs.js):
ValidationError: CSS Loader Invalid Options

options should NOT have additional properties

I verified this by manually deleting the property from the webpack config:

webpack(config, options) {
    if (!options.isServer) {
      delete config.module.rules[config.module.rules.length - 1].use[2].options.minimize
    }
    return config
}

I've tried setting cssLoaderOptions but it doesn't seem to have any effect.

It looks like this may have been fixed for next-css, but not next-less?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants