CesiumGS / cesium-webpack-example

The minimal recommended setup for an application using Cesium with Webpack.
Apache License 2.0
243 stars 160 forks source link

Webpack 4 example #53

Closed jjspace closed 7 months ago

jjspace commented 8 months ago

This PR adds a separate example for Webpack version 4 alongside Webpack 5. Ideally most people should be on version 5 as soon as possible and on all new products. However, older projects or ones using older versions of frameworks like Nuxt2 and older Angular versions still rely on Webpack version 4

There are some challenges wrapped in getting this to work for Webpack 4 which mostly stem from using newer JS features that Webpack doesn't know how to support.

I also updated the github actions to make sure to perform the build checks and linting against both webpack 4 and 5 versions.

Testing

There should not be any errors in the console or on the page for both version 4 and 5

jjspace commented 8 months ago

@ggetz I wasn't totally sure the best place to do linting so right now it's in each directory as a "complete package" but it may make more sense to still initialize the whole project as a npm project and do it only at the top level? I haven't worked with npm workspaces or anything but would that make more sense here?

I also realized that this method may not work with husky? Thoughts?

jjspace commented 8 months ago

@ggetz I restructured the packages a little pulling eslint, prettier and husky up to the top level as discussed this morning. I tried using the npm workspaces but realized that it's optimizations for package install locations make the examples trickier, specifically the "copy static files" step. I decided to not use workspaces in favor of having each example stand on it's own and work in isolation to allow people to copy it into their own project easier.

jjspace commented 7 months ago

Thanks for the comments @ggetz, I've addressed or responded to them all, please take another look

jjspace commented 7 months ago

@ggetz updated again, I reorganized the main readme to avoid confusion

ggetz commented 7 months ago

Awesome. Thanks @jjspace!