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

Webpack Dev Server Refactor + Build Tools Updates #923

Merged
merged 9 commits into from
Oct 24, 2018

Conversation

sghoweri
Copy link
Contributor

@sghoweri sghoweri commented Oct 19, 2018

Jira

http://vjira2:8080/browse/BDS-678

Summary

Refactors and updates Bolt's build tools which include several important updates:

  • Switches us over from using the now deprecated webpack-serve library to use the recommended webpack-dev-server library for continued support and updates
  • Updates the build so Hot Module Reloading (HMR) JavaScript and CSS files compiled by Webpack now works exactly as expected
  • Adds HMR support for HTML files while using Webpack Dev Server -- eliminating the need for our original Browsersync + Webpack proxy configuration
    • This also adds an internal cache so only HTML files with actual content changes cause the browser to reload
  • Updates the Bolt build tools' CLI to log info about your local dev server setup -- similar to how Browsersync would output your local server IP + URL for easy access
  • Adds new experimental cache support to the Bolt build tools via the Webpack Hard Source plugin @EvanLovely PR'd in speeding up WebPack builds by adding hard-source-webpack-plugin #914 but as an optional opt-in feature till some occasional bugs are ironed out.

Excitingly, this update can significantly help speed up local front-end dev builds after Webpack compiles for the very first time.

In testing this out locally, the 2nd time it took to boot up the Webpack Dev Server went from around 45 seconds initially (the first time booting up Webpack) and dropped down to < 5 seconds.. a 900% speed increase!

image

@bolt-bot
Copy link
Collaborator

⚡ PR built on Travis and deployed a now preview here:

@sghoweri sghoweri added this to the v2.2 milestone Oct 24, 2018
# Conflicts:
#	packages/build-tools/package.json
#	yarn.lock
@bolt-bot
Copy link
Collaborator

⚡ PR built on Travis and deployed a now preview here:

Copy link
Collaborator

@remydenton remydenton left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for removing the zip files from the 2.1.2 release-- sorry about that. I also removed them in a2fa207.

Heads up to @mikemai2awesome that you can remove enableCache: true from apps/pattern-lab/.boltrc.js if you experience issues with caching.

@remydenton remydenton merged commit e39cc5c into master Oct 24, 2018
@remydenton remydenton deleted the feature/webpack-dev-server-refactor branch October 24, 2018 21:52
@remydenton remydenton mentioned this pull request Oct 24, 2018
This was referenced Nov 18, 2018
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.

3 participants