Updating the Sage 9 webpack config

Has anyone done significant work updating the Sage 9 webpack config by any chance?

We’re working on some legacy projects and I’m not sure what’s out of date but we’re constantly stuck in weird reloading loops - which a search of this forum returns a lot of results for - but is something I’ve never seen a proper fix for.

But if anyone has overhauled Sage 9’s build process and would like to share we’d be very interested.

We’ve done some work on a small scale removing SCSS for just postcss but it’s not fixed these particular problems.

First you may want to sync the package versions and webpack configs of latest commit in sage 9 branch. If you have already done that and for further updating, see this guide:

So this is how I am updating (or have updated) sage 9 projects (this can be used for other types of projects as well):

  1. Your project should already be under version control, create a new update branch if you like to make the process cleaner.
  2. Run the david tool for a table of updateable dependencies.
    Note that a change in the minor- or patch-version should - ideally - not break compatibility, so you can now update each dependency to the latest minor- or patch-version individually, where possible, and re-run the webpack build process each time to check whether something breaks. Consult the npm versions section of a package, if the version jump is too big, to stay inside the same major version. Commit the package version changes regularly so you can easily revert to a working, updated set of packages.
  3. Now you can try to be more daring and update to major versions. Do this for each package again individually, when possible, and check whether the build still works.
  4. In the end you should end up with a small or even empty (congrats!) update table when you run david, while the build still works.

This approach reminds a bit of git-bisect, not with commits but rather with package versions. This could be even automated, though smaller manual tweaks to config may be necessary.

2 Likes

Thanks this is a helpful guide

This topic was automatically closed after 42 days. New replies are no longer allowed.