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

Allow custom webpack config for federated extensions #9224

Merged
merged 7 commits into from Oct 29, 2020

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Oct 24, 2020

References

Fixes #9175

Should also cover the use case mentioned in #4328

Code changes

Allow extension authors to provide a custom webpack config for their federated extension.

TODO

  • Read default webpack.config.js from the federated extension
  • Add a subkey in the jupyterlab config in the package.json to point to the custom webpack config
  • Add documentation in the extension developer guide: mention that this extension point is experimental

User-facing changes

None

Backwards-incompatible changes

None user facing.

For developers, this exposes a direct way to configure webpack for federated extensions.

@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@jtpio
Copy link
Member Author

jtpio commented Oct 27, 2020

See #9175 for more context.

And jtpio/jupyterlab-wasm-example#4 as an example for what it would look like from a third-party extension.


// Use the custom webpack config only if the path to the config
// is specified in package.json (opt-in)
if (webpackConfigPath) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This makes it opt-in, meaning that even if a webpack.config.js file is at the root of the federated extension folder, it will not be picked up unless explicitly specified in package.json under the jupyterlab.webpackConfig subkey.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. I think that is really important to be explicit about this, especially given it is an experimental feature. We only want it available to people that really explicitly want to use it.

@jtpio jtpio marked this pull request as ready for review October 27, 2020 14:45
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@blink1073 blink1073 added this to the 3.0 milestone Oct 27, 2020
@jasongrout
Copy link
Contributor

Thanks!

@jasongrout jasongrout merged commit 1f1f9f5 into jupyterlab:master Oct 29, 2020
1 check was pending
@jtpio jtpio deleted the custom-webpack-config branch October 29, 2020 08:33
@github-actions github-actions bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Apr 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom webpack.config.js for federated extensions
3 participants