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

feat(webpack): Support incremental builds via buildLibsFromSource #25060

Merged
merged 1 commit into from
May 27, 2024

Conversation

ndcunningham
Copy link
Contributor

This PR adds the ability for incremental builds when using the Webpack Plugin.

Instead of using the source library directly, you can now utilize the output folder by utilizing the buildLibsFromSource option within your webpack.config file, through NxAppWebpackPlugin. This means that instead of accessing mylib/src/index.ts, it will access dist/mylib/index.js.

This directly aligns with incremental builds as it ensures that the build process only recompiles the source doe that has been modified since the last build.

@ndcunningham ndcunningham self-assigned this May 22, 2024
@ndcunningham ndcunningham requested a review from a team as a code owner May 22, 2024 18:34
@ndcunningham ndcunningham requested a review from Coly010 May 22, 2024 18:34
Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview May 27, 2024 3:07pm

@ndcunningham ndcunningham force-pushed the feat/webpack-plugin-build-lib-from-source-option branch from 975d0f2 to b3fbc96 Compare May 24, 2024 18:36
@ndcunningham ndcunningham requested a review from Coly010 May 24, 2024 20:12
@ndcunningham ndcunningham force-pushed the feat/webpack-plugin-build-lib-from-source-option branch from b3fbc96 to 17432a9 Compare May 27, 2024 15:04
@jaysoo jaysoo merged commit 6292055 into master May 27, 2024
6 checks passed
@jaysoo jaysoo deleted the feat/webpack-plugin-build-lib-from-source-option branch May 27, 2024 18:04
ndcunningham added a commit that referenced this pull request May 28, 2024
…5060)

This PR adds the ability for incremental builds when using the Webpack
Plugin.

Instead of using the source library directly, you can now utilize the
output folder by utilizing the `buildLibsFromSource` option within your
webpack.config file, through `NxAppWebpackPlugin`. This means that
instead of accessing `mylib/src/index.ts`, it will access
`dist/mylib/index.js`.

This directly aligns with incremental builds as it ensures that the
build process only recompiles the source doe that has been modified
since the last build.
FrozenPandaz pushed a commit that referenced this pull request May 28, 2024
…5060)

This PR adds the ability for incremental builds when using the Webpack
Plugin.

Instead of using the source library directly, you can now utilize the
output folder by utilizing the `buildLibsFromSource` option within your
webpack.config file, through `NxAppWebpackPlugin`. This means that
instead of accessing `mylib/src/index.ts`, it will access
`dist/mylib/index.js`.

This directly aligns with incremental builds as it ensures that the
build process only recompiles the source doe that has been modified
since the last build.

(cherry picked from commit 6292055)
Copy link

@therk therk left a comment

Choose a reason for hiding this comment

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

@ndcunningham what is the easiest way to set buildLibFromSource to false without creating a custom webpack.config.js file? This change is causing failures form my project when used with cypress component tests library that is referencing Storybook Library module in the project.

Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants