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

[rush] Add support for rush-sdk to be webpacked. #3208

Merged
merged 6 commits into from
Feb 6, 2022

Conversation

iclanton
Copy link
Member

@iclanton iclanton commented Feb 5, 2022

Summary

Currently rush-sdk can't be used in a project that has been bundled with Webpack.

Details

This PR replaces instances of require() in rush-sdk with a call to a function that detects if we're executing inside a webpack bundle and calls a Webpack macro function that maps to the real require function instead of the built-in Webpack require (which errors in this case).

How it was tested

Tested by bundling a small tool that uses rush-lib via rush-sdk with Webpack 5 and executing the bundle.

@octogonz
Copy link
Collaborator

octogonz commented Feb 5, 2022

CC @elliot-nelson

@iclanton iclanton requested a review from patmill as a code owner February 6, 2022 06:38
@iclanton iclanton merged commit a5c7c3c into microsoft:master Feb 6, 2022
@iclanton iclanton deleted the rush-sdk-webpack branch February 6, 2022 07:20
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.

2 participants