Next-plugins: @zeit/next-css: Remove minimize option

Created on 25 Sep 2018  路  7Comments  路  Source: vercel/next-plugins

The minimize option has been removed in css-loader 1.0.0 which is now used ( 91bf70af7d9e042aafc3c2824665c01e76078abe).

To avoid confusion (there is currently no minification) we should remove the line in https://github.com/zeit/next-plugins/blob/2db666d9adf96bb16532caf5048b7b44e115222d/packages/next-css/css-loader-config.js#L76

All 7 comments

Feel free to send a pull-request.

I found it very convenient that next-css automatically minified the CSS. Can we get that back?

Looking for some clarification, does a postcss.config.js need to be present for postcss-loader to be included? Or can we just config it in next.config's postcssLoaderOptions?

The readme says You can also pass a list of options to the postcss-loader by passing an object called postcssLoaderOptions.

But lines 49-68 in css-loader-config.js only handles the case when postcss.config.js file is present.

327 solves the automatically minimizing

Hey guys,

the minimize option is still on the npm version of this plugin which causes build error on pnpm
image

image

The file on the repo is different
image

Invalid options seems to be ignored by npm and yarn because project builds fine. Any input on this would be appreciated.

From my packeage.json
image

Next.js has built-in support for css and sass: https://nextjs.org/docs/basic-features/built-in-css-support we recommend using the built-in support which solves numerous edge cases and adds additional optimizations

Next.js has built-in support for css and sass: https://nextjs.org/docs/basic-features/built-in-css-support we recommend using the built-in support which solves numerous edge cases and adds additional optimizations

when i removed @zeit/next-css from next.config.js and package.json, thereby moving to the built-in CSS support upon upgrading to 9.2.0

I started getting this loader error.

1:0\nModule parse failed: Unexpected character \'@\' (1:0)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n> @font-face{font-family:"sofia-pro";src:url("https://use.typekit.net/af/5855b2/00000000000000003b9b1a98/27/l?subset_id=2&fvd=n4&v=3") format("woff2"),url("https://use.typekit.net/af/5855b2/00000000000000003b9b1a98/27/d?subset_id=2&fvd=n4&v=3") format("woff"),url("https://use.typekit.net/af/5855b2/00000000000000003b9b1a98/27/a?subset_id=2&fvd=n4&v=3") format("opentype");font-style:normal;font-weight:400;font-display:swap}@font-face{font-family:\'FontAwesome\';src:url(\'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts//fontawesome-webfont.eot?v=4.7.0\');src:url(\'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts//fontawesome-webfont.eot?#iefix&v=4.7.0\') format(\'embedded-opentype\'),url(\'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts//fontawesome-webfont.woff2?v=4.7.0\') format(\'woff2\'),url(\'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts//fontawesome-webfont.woff?v=4.7.0\') format(\'woff\'),url(\'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts//fontawesome-webfont.ttf?v=4.7.0\') format(\'truetype\'),url(\'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts//fontawesome-webfont.svg?v=4.7.0#fontawesomeregular\') ...

Was this page helpful?
0 / 5 - 0 ratings