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

Refactor Webpack Configs #1983

Merged
merged 4 commits into from
Jan 22, 2020
Merged

Conversation

rdig
Copy link
Member

@rdig rdig commented Jan 21, 2020

Description

This PR started it's life as a way to do cache-busting in new deployments by inserting a content hash in the name of the outputted bundle.

In the end it turned into:

  • Added content hash string to the outputted chunks (in production)
  • Split the bundle into three main parts: main, libs, vendors (in production)
  • Vendors has the benefit on not changing that often, meaning it can be cached by the clients
  • Refactored the webpack configs for saner maintenance (dev and production now inherit from base, and only add in they're required config declarations)

The next step in this saga, is to add in code splitting, ... at some point.

New stuff

  • Added clean-webpack-plugin package
  • Added new webpack base config, from which all else inherit
  • Added new webpack prod config, for production env builds
  • Added new webpack dev config, for development env builds and out of which the yarn dev server runs

Deletions

  • Removed old webpack.config.js development config
  • Removed old webpack.config.prod.js production config

Screenshots

Screenshot from 2020-01-21 16-35-17

@rdig rdig added this to the Sprint 42 milestone Jan 21, 2020
@rdig rdig requested review from chmanie and ceolson01 January 21, 2020 14:46
@rdig rdig self-assigned this Jan 21, 2020
Copy link
Contributor

@ceolson01 ceolson01 left a comment

Choose a reason for hiding this comment

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

This looks good to me - nice improvements. Also, thanks for commenting so thoroughly for our future selves 👍

@rdig rdig force-pushed the feature/webpack-cachebusting-checksummed-bundle branch from 55d0d78 to 098829b Compare January 22, 2020 15:24
@rdig rdig merged commit 439df0d into master Jan 22, 2020
@rdig rdig deleted the feature/webpack-cachebusting-checksummed-bundle branch January 22, 2020 15:30
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