Support `postcss-load-config` >= 4.x
Version 4.x of postcss-load-config has a breaking change; it drops the sync() method upon which the default ESBuild configuration of Bridgetown relies.
See https://github.com/postcss/postcss-load-config/pull/234 for more information.
Bridgetown Version:
bridgetown 1.1.0.beta3 "Belmont"
To Reproduce
- Upgrade
postcss-load-configto^4.0.0inpackage.json. - Run
yarnin the project. - Run
bin/bridgetown start - Compilation fails due to error below
node esbuild.config.js --watch
[Frontend] /Users/stefan/code/org/project/config/esbuild.defaults.js:180
[Frontend] const postCssConfig = postcssrc.sync()
[Frontend] ^
[Frontend]
[Frontend] TypeError: postcssrc.sync is not a function
Current behavior
Bridgetown fails to compile the CSS.
Expected behavior
Bridgetown compiles the CSS.
Screenshots
...
Computing environment (please complete the following information):
- OS: MacOS
Additional context
I'd like to submit a PR for it and address it. However, I'm not 100% sure how the ESBuild configuration is set up and works for Bridgetown. Would need to dive a little bit deeper.
@stefanvermaas Thanks for mentioning this. We'll definitely need to stay pinned to 3.x for the time being. IMHO that's a pretty ridiculous breaking change, but we've gotta play the hand we're dealt. I'm guessing we'll need to figure out some kind of async/await wrapper for the part of the script where it loads in the config…easier said than done because currently it's at the top level of the esbuild config script. I forget exactly which version of Node adds top-level async/await, but it's definitely higher than Bridgetown's minimum supported Node version at present.
Thanks for mentioning this. We'll definitely need to stay pinned to 3.x for the time being.
Shall I proceed and create a PR for this? It might be the best solution for the short term.
MHO that's a pretty ridiculous breaking change, but we've gotta play the hand we're dealt.
Agreed.
I forget exactly which version of Node adds top-level async/await, but it's definitely higher than Bridgetown's minimum supported Node version at present.
I see. I'm not sure if it makes sense to already switch to a higher version if only one package needs it.
@stefanvermaas
Shall I proceed and create a PR for this? It might be the best solution for the short term.
I believe in the site template's package.json, it's already pinned to 3.x, so we should be fine for the time being.