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

#42 Support Webpack v5 #43

Merged
merged 147 commits into from
May 18, 2021
Merged

#42 Support Webpack v5 #43

merged 147 commits into from
May 18, 2021

Conversation

kellymears
Copy link
Member

@kellymears kellymears commented Apr 4, 2021

Type of change

  • MAJOR: breaking change

Affected packages

  • all packages

Issues fixed

Details

This is a work-in-progress.

Todo

  • Fix: runtimeChunks are not emitted in asset manifests
  • Fix: Minify optimizations are not applied to CSS.

Notes

  • Using css-minimizer-webpack-plugin instead of optimize-css-assets-webpack-plugin.
    • optimize-css-assets-webpack-plugin throws warnings. Docs say to use css-minimizer-webpack-plugin instead.
    • Commits: 5255c68, 578833c, 361a732.
  • Removed bud.vendor method from @roots/bud-api. Replaced with bud.splitChunks.
    • Removed keys from hooks/config:
      • build/optimization/splitChunks/chunks
      • build/optimization/splitChunks/minSize
      • build/optimization/splitChunks/maxSize
      • build/optimization/splitChunks/maxAsyncRequests
      • build/optimization/splitChunks/maxInitialRequests
      • build/optimization/splitChunks/cacheGroups
      • build/optimization/splitChunks/cacheGroups/vendor
      • build/optimization/splitChunks/cacheGroups/vendor/priority
      • build/optimization/splitChunks/cacheGroups/vendor/... (everything from here on is gone)
    • This means that users who wish to modify the vendor chunk either need to include the config keys between splitChunks and vendor in the config param of bud.splitChunks, or overwrite the config in total using bud.hooks.on('build/optimization/splitChunks').
    • It was all just entirely too much.
  • Webpack v5 is so much more optimized than v4, it's cray. Taking advantage of that with a default parallelism value of os.cpus().length - 1 (previously set to 1)
  • Removes src, srcPath, dist, distPath, project api fns in favor of a consolidated approach: bud.path and bud.setPath.
  • Types are no longer exported explicitly from @roots/bud-support. Types should be imported using import type directly from the package. Packages which export types should be added to the repo root package.json.
  • @roots/bud-compiler no longer derives its type definition from @roots/bud-typings. See: Deprecate internal usage of @roots/bud-typings #48.
  • @roots/bud-build no longer derives its type definition from @roots/bud-typings. See Deprecate internal usage of @roots/bud-typings #48.
  • updates all asset manifest plugins to use the processAssets hook. webpack 5 no longer allows assets to be modified during the compiler emit phase.
  • Adds support for static config files (yml and json)
  • Adds support for env specific config files (bud.production.config.js, etc.)
  • Adds support for ts config files (ts is not required in the project to take advantage of this)

@kellymears kellymears added dependencies Pull requests that update a dependency file @roots/bud-framework webpack labels Apr 4, 2021
@kellymears kellymears self-assigned this Apr 4, 2021
@kellymears kellymears mentioned this pull request Apr 4, 2021
3 tasks
*/
public htmlWebpackPlugin: HtmlWebpackPlugin
public htmlWebpackPlugin: any
Copy link
Member Author

Choose a reason for hiding this comment

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

Something weird happening with this type definition. Setting to any temporarily.

@kellymears kellymears marked this pull request as ready for review May 18, 2021 05:59
@kellymears kellymears merged commit d6db721 into stable May 18, 2021
@QWp6t QWp6t deleted the webpack-5 branch May 20, 2021 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file @roots/bud-framework webpack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate internal usage of @roots/bud-typings Support Webpack v5 ESBuildPlugin deprecation notice
2 participants