-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packages: Mark build-styles as side-effectful #19535
Conversation
ab79a68
to
d5c5f89
Compare
Here's some concrete testing steps:
diff --git a/webpack.config.js b/webpack.config.js
index e4e2ba6505..144b093349 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -150,7 +150,7 @@ const webpackConfig = {
'entry-login': [ path.join( __dirname, 'client', 'landing', 'login' ) ],
'entry-gutenboarding': [ path.join( __dirname, 'client', 'landing', 'gutenboarding' ) ],
},
- mode: isDevelopment ? 'development' : 'production',
+ mode: 'production',
devtool: process.env.SOURCEMAP || ( isDevelopment ? '#eval' : false ),
output: {
path: path.join( __dirname, 'public', extraPath ),
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming that this fixes the issue we saw by following these instructions: #19535 (comment)
Only those 2 packages are affected? |
I compiled the packages ( |
Workaround for regression in package. See: WordPress/gutenberg#19535
* Declare sideEffects for build-style * fixup! Declare sideEffects for build-style * Add CHANGELOG entries
Description
In Automattic/wp-calypso#38554 we observed some styling regressions when importing component styles from
@wordpress/components/build-styles
. This appears to be a regression introduced in #18911. Styles are side-effectful, and should be declared as such. Packages that includebuild-styles
intended for use from the published package must be marked as such. The webpack docs on tree shaking mention this:source
This PR marks
build-style/**
as having side-effects for packages that were observed to produce abuild-style
directory and were markedsideEffects: false
. An alternative would be to add*.css
and*.scss
to the list, however.How has this been tested?
When manually applying the change in this PR to the installed package where the regression was observed, the issue is fixed.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Fixes a regression published in
@wordpress/[email protected]
that would prevent some build tools from including styles provided in the packagesbuild-styles
directory.Fixes a regression published in
@wordpress/[email protected]
that would prevent some build tools from including styles provided in the packagesbuild-styles
directory.Checklist: