Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

feat(decorateClientConfig): Upgrade to version 4 #45

Merged
merged 1 commit into from
Nov 16, 2018

Conversation

michaeltaranto
Copy link
Contributor

Upgrades the decorators to support webpack v4. We have made it this far because most apps are running sku which handles this for you.

The primary change for consumers is around the handling of styles emitted from the style guide compilation. The client decorator now has a cssOutputLoader option allowing you to configure the final loader in the css pipeline.

BREAKING CHANGE: Removed the client decorator option extractTextPlugin in favour of
cssOutputLoader. Also upgrading from webpack 3 to 4 so any plugins/loaders would need to be
supported by 4.

Migration Guide

Consumers will need to migrate their applications to support webpack v4, which will be project specific based on the webpack config.

Beyond the webpack upgrade, only consumers using the extractTextPlugin option in the client decorator need to migrate to the new cssOutputLoader option. The extract-text-webpack-plugin is not supported in webpack 4, but mini-css-extract-plugin is essentially a drop in replacement.

-const ExtractTextPlugin = require('extract-text-webpack-plugin');
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');

-const extractCss = new ExtractTextPlugin({
+const extractCss = new MiniCssExtractPlugin({
  filename: 'style.css'
});

const webpackConfig = {
  ...
  plugins: [
    extractCss
  ]
};

module.exports = decorateClientConfig(webpackConfig, {
-  extractTextPlugin: extractCss
+  cssOutputLoader: MiniCssExtractPlugin.loader
});

BREAKING CHANGE: Removed the client decorator option `extractTextPlugin` in favour of
`cssOutputLoader`. Also upgrading from webpack 3 to 4 so any plugins/loaders would need to be
supported by 4.
@michaeltaranto michaeltaranto merged commit 002be06 into master Nov 16, 2018
@michaeltaranto michaeltaranto deleted the upgrade-webpack-4 branch November 16, 2018 04:25
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.

2 participants