Skip to content
This repository was archived by the owner on Jun 5, 2021. It is now read-only.

Conversation

@dancompton
Copy link
Contributor

@dancompton dancompton commented Oct 16, 2018

This PR replaces the invocation of (deprecated) webpack-serve with that of webpack-dev-server in internal/web_bundle/rule.bzl. An additional file attr, dev_server_options, is added to _web_bundle which allows the consumer to override the default webpack-dev-server options defined in 8997a33

@CLAassistant
Copy link

CLAassistant commented Oct 16, 2018

CLA assistant check
All committers have signed the CLA.

@dancompton dancompton force-pushed the webpack-dev-server branch 2 times, most recently from 62dd295 to c526c5d Compare October 16, 2018 18:31
Copy link
Owner

@fwouts fwouts left a comment

Choose a reason for hiding this comment

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

Thanks so much! Here I was using webpack-serve trying to be a good citizen by not relying on a deprecated package... :)

@@ -0,0 +1,7 @@
var options = {
Copy link
Owner

Choose a reason for hiding this comment

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

Could you make this const?

@dancompton
Copy link
Contributor Author

@fwouts 👍

Also, a couple questions for you:

  1. Have you looked at the new rollup_bundle in the bazelbuild/rules_nodejs? Do you think that's an acceptable replacement for a custom webpack rule (I'm not a front-end engineer).

  2. It looks as though the web_bundle rule was written the way it was (in-part) to solve issues with webpack + bazel that. Is this correct and do those issues preclude one from simply allowing a complete webpack configuration to be provided via file attr rather than via code generation?

@fwouts
Copy link
Owner

fwouts commented Oct 17, 2018

Hi Dan,

  1. I haven't looked into it in detail. My understanding is that Rollup is great for bundling ES code, but unlike webpack it doesn't have first-class support for non-ES assets such as CSS, images, etc (and webpack plugins give you a lot of flexibility). But I could be completely wrong. I simply picked webpack because that's what I was most familiar with :-)

  2. The main reason for allowing a webpack config file to be passed through is that a few things need to be customised, such as the node_modules location needs to be provided by Bazel. There are probably better ways to do this—what do you have in mind?

@dancompton
Copy link
Contributor Author

1 -- Thanks for the explanation!
2 -- I had nothing specific in mind. I was trying to wrap my head around the trade-offs made by the dropbox implementation here: https://github.com/dropbox/rules_node/blob/master/node/defs.bzl#L786-L904

@fwouts
Copy link
Owner

fwouts commented Nov 21, 2018

Sorry, I forgot to merge this. Fixing it up and merging soon.

@fwouts fwouts merged commit b61c90d into fwouts:master Nov 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants