-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Swap babel for ESBuild and upgrade to Webpack 5 #334
Conversation
Ooooooooo. (That is all. I don't have anything to add, other than, sounds awesome!) |
run "bundle exec bridgetown configure purgecss" | ||
|
||
if File.exist?("frontend/styles/index.css") |
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.
Just guarding against a case where index.css
doesn't exist and printing out what the user needs to include in their CSS.
Unlikely to happen but could be the case if someone created a site using sass and then converted to postcss. We don't update the CSS/JS setup when enabling postcss on an existing site as it'd be too complicated.
@@ -41,11 +41,18 @@ def self.destination_root | |||
config.root_dir | |||
end | |||
|
|||
protected |
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 forgot that Thor::Group
runs all the public instance methods on the class. I've moved the config
helper to protected now, It might, just might, have been the cause of the test suite crashes although I can't really explain why.
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.
Nothing to do with the crashes whatsoever; but an improvement nonetheless I reckon
Hey @jaredcwhite, I think this is good to go. Let me know if you have any feedback! Thanks :) |
I like the idea of switching to Would definitely be cool to get this in the next release. |
Sure, take your time. I don't anticipate it breaking any sites but you never know so best to be safe! |
…o babel-for-esbuild # Conflicts: # bridgetown-core/test/test_webpack_command.rb
Webpack 5 upgrade
Upgrading to Webpack 5 turned out to be easier than I thought. Much easier than my last attempt about 6 months ago. Clearly I've learned how to tame the beast! :D Anyway I've tacked that onto this PR since the changes were pretty small. But that does mean we need to test this quite thoroughly. I'll test it on a few of my websites in the coming days. |
I tried this on 3 of my websites and it worked just fine! |
…o babel-for-esbuild # Conflicts: # bridgetown-core/lib/site_template/package.json.erb
@ayushn21 Sounds great. I'll prioritize getting this into the next release (0.21.1). |
@ayushn21 We probably need an upgrade guide or some kind of documentation somewhere. For example I'd like to update the BT website itself but not quite sure what to do. Or is it as easy as just running |
Yup it's just |
@ayushn21 Website all ready to go! I also swapped the old |
This is a 🙋 feature or enhancement.
I thought it'd be a good idea to swap Babel for ESBuild since it's much faster. (I don't have anything more than anecdotal experience that says its better though so happy to revert if required).
I've also reorganized the default webpack configuration by breaking a bunch of stuff out into variables which hopefully makes it cleaner and easier to read!
This needs a bit more testing before merging as well. I've verified that a new site with Sass works but just need to check configurations and a postcss website. I don't foresee any problems though.
esbuild
packages in webpack update commandCloses #204