-
Notifications
You must be signed in to change notification settings - Fork 270
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
Don't include static files in the build. #43
Conversation
sed "s/<?php/<?php define( 'CONCATENATE_SCRIPTS', false );/" wp-config.php > wp-config.php.new | ||
mv wp-config.php.new wp-config.php |
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.
I'd move this to src/shared/wordpress.mjs
just because all the other WordPress customizations live there – I'd like to avoid the fragmentation.
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.
Hm, on the other hand this is a build feature. You can't remove assets without setting CONCATENATE_SCRIPTS
to false. Alright – good call putting it here!
YAY! I was hoping this is possible somehow! Thank you @dd32, 31 MB is a huge win! About the change – It doesn't seem to request Edit: WordPress does indeed check that in multiple places like Edit: There's a code path that loads block styles inline with wp_add_inline_style( "wp-block-{$block_name}", file_get_contents( $path ) ); I wonder if we can disable it. |
Would the following work:
See more in: https://make.wordpress.org/core/2021/07/01/block-styles-loading-enhancements-in-wordpress-5-8/ |
bcb141b
to
0cb7e62
Compare
@gziolo Unfortunately it didn't help :-( My guess is the filter works for the styles referenced by path that opt-in to the optional inlining: wp_style_add_data( $style_handle, 'path', $file_path ); However, the inline block styles are inlined using their content – there is no URL to fall back to when the filter is wp_add_inline_style( "wp-block-{$block_name}", file_get_contents( $path ) ); 13M is a huge improvement compared to the 44M before this PR so I'd say let's merge and keep iterating in follow-up PRs :-) |
Oh no, I removed |
Fixes #39, See #2
This appears to reduce the bundle size significantly, unless I've done something massively wrong.
Testing
npm run build:wp
npm run dev