question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Reduced support for webpack

See original GitHub issue

When we started with open-wc, using rollup for web apps was still pretty new. We started out with configs and recommendations for both webpack and rollup, and were mostly neutral in our recommendations between the two.

Over time the story for using rollup for web apps improved a lot and we starting leaning more and more towards Rollup. We now generally recommending it for all use cases.

As a project open-wc has grown a lot, we picked up a lot of tools, guides and configurations over time. All these things cost time to maintain. We have to be careful we don’t grow too big, and sometimes let go of things that no longer fit with the goal of open-wc or things that didn’t work out so well.

Whenever we add new things for rollup, our current policy is to also add an equivalent for webpack. I’d like to change that strategy, going more all-in on rollup and reducing the level of support we have for webpack.

I don’t want to forget about webpack users, a lot of people don’t have the freedom to choose their tools and we still should provide guidance and building web components for them. But these same people likely cannot use our plugins or configs, but need to integrate in an existing build setup. Our documentation and recommendations should focus on that, and it’s actually an area we are lacking in already.

In practice, I’m proposing the following changes:

  • Deprecate webpack-index-html-plugin
  • Remove the multi-build option from building-webpack (which was always a hack anyway)
  • Use webpack-plugin-html in building-webpack (losing the ability to use HTML as input)
  • Add docs on web component specific requirements when integrating with an existing webpack config
  • Remove webpack option from generator
  • Make rollup more prominent in our docs

This is not something we will do overnight, I’d like to gather feedback (from other maintainers & the community) on this approach first.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
LarsDenBakkercommented, Mar 8, 2020

I dont agree, I have used both extensively and I find rollup a lot simpler to understand and use.

We recommend building web components with es modules, and to load polyfills as scripts.

1reaction
emilio-martinezcommented, Mar 24, 2020

I kind of tend to agree with a full webpack config may not be worth the maintenance. To be honest, it’s great from a “getting started” point of view, but depending on the requirements of various projects, I’ve ended up just using it as reference due to the need to heavily customize the webpack config anyway, or having to integrate it into an existing webpack pipeline.

Would it make sense to just convert the package into a set of utilities/plugins for people to piece together their own config? For example, the particulars of the babel config would become a babel preset? After all, some parts are already their own open-wc packages now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC: Webpack Performance Budgets · Issue #3216 - GitHub
The less conservative number of 250KB is an upper bound estimate. Code-splitting and confusion. A surprising 58%+ of responders said they were ...
Read more >
RFC: Changing how we handle Webpack Building
This RFC aims to address issues that developers have raised with the current webpack workflow. There have been a number of proposed ...
Read more >
Why you should use Compression Webpack Plugin?
You can use zopfli with compression webpack plugin. Brotli. Brotli is a recent compression algorithm (RFC 7932) with a great browser support.
Read more >
Change: "Jest uses custom config" to "Jest uses webpack" (#5 ...
(Under investigation) Possible reduction in speed of unit tests. Webpack builds and bundles much more than jest does.
Read more >
Other Options - webpack
Set the value of require.amd or define.amd . Setting amd to false will disable webpack's AMD support. webpack.config.js
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found