Skip to content
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

Migrate from snowpack to webpack #515

Merged
merged 15 commits into from
Jul 25, 2022
Merged

Migrate from snowpack to webpack #515

merged 15 commits into from
Jul 25, 2022

Conversation

jonandernovella
Copy link
Contributor

Reason for this PR

The snowpack project is not under active maintenance any longer so it's a good idea to switch to a widely adopted tool such as webpack.

Type of change

  • New feature (non-breaking change which adds functionality)

List of changes made

  • Producttion build works with webpack
  • Dev server with hot reload powered by webpack

Testing

  1. Bring down all containers and volumes
  2. Update your env accordingly
  3. Build prod or dev setup
  4. Start the services and navigate to localhost:4567
  5. Test updating the css code and see if HR works

Definition of Done checklist

  • I have made an effort making the commit history understandable
  • I have performed a self-review of my own code and commented any hard-to-understand areas
  • Tests and lint/format validations are passing
  • My changes generate no new warnings

This makes sure that env vars are passed accordingly and the dev server serves the bundle from /public
This makes sure we can read our env vars at build time and on the dev setup.
@jonandernovella jonandernovella requested a review from a team July 7, 2022 11:36
@jonandernovella jonandernovella self-assigned this Jul 7, 2022
Copy link
Contributor

@HenrikeW HenrikeW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build works smoothly, and so does the hot reload. But parts of the CSS broke on the way, compare mostly the footer in the two screenshots. First the branch from this PR, below the current develop branch.
No idea so far what can have caused this.

image
image

@jonandernovella jonandernovella requested a review from HenrikeW July 8, 2022 07:22
Copy link
Contributor

@HenrikeW HenrikeW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it looks like it did before, nice!

Handlebars is used for templating index.html
This is now automatically generated by webpack
The build is now optimised and is much smaller.
@jonandernovella
Copy link
Contributor Author

The build should be much smaller now. I have tested both the dev and production setup and they are working well.

This should make sure we have different checksums only on modules that have changed. Also, the bundling strategy has been updated to allow for a faster loading of assets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants