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

merge default options and the prebuild options provided in ember-cli-build #1837

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

BlueCutOfficial
Copy link
Collaborator

@BlueCutOfficial BlueCutOfficial commented Mar 7, 2024

Recently, the prebuild function has been written in the default-pipeline so we can run the build with Vite requirements by default:

// ember-cli-build.js

- return compatBuild(app, undefined, {
-     staticAddonTrees: true,
-     staticAddonTestSupportTrees: true,
-     staticComponents: true,
-     ...
-   });
+ return prebuild(app);

However, there was an issue with the way prebuild uses the options: If an options object was provided in ember-cli-build.js, this would replace entirely the defaultPrebuildOptions that Vite requires and options like staticAddonTrees and staticEmberSource would be false instead of true, resulting to breaking side effects.

This PR changes prebuild function to always use the defaultPrebuildOptions and extend them with the passed options.

How to test manually

  • In tests/vite-app/ember-cli-build.js, do the following change:
- return prebuild(app);
+ return prebuild(app, {});
  • Then run the vite-app.
  • 👀 The app should run correclty

@BlueCutOfficial BlueCutOfficial marked this pull request as ready for review March 7, 2024 12:15
@BlueCutOfficial BlueCutOfficial requested a review from mansona March 7, 2024 12:15
@BlueCutOfficial BlueCutOfficial changed the title fix(prebuild options): always merge the default options to the build options provided by ember-cli-build fix(prebuild options): always merge the default options and the build options provided by ember-cli-build Mar 7, 2024
Copy link
Member

@mansona mansona left a comment

Choose a reason for hiding this comment

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

🎉

@mansona mansona added the bug Something isn't working label Mar 7, 2024
@mansona mansona changed the title fix(prebuild options): always merge the default options and the build options provided by ember-cli-build merge default options and the prebuild options provided in ember-cli-build Mar 7, 2024
@mansona mansona merged commit f30e685 into main Mar 7, 2024
95 checks passed
@mansona mansona deleted the fix-default-pipeline-prebuild-options branch March 7, 2024 15:31
@github-actions github-actions bot mentioned this pull request Mar 5, 2024
@github-actions github-actions bot mentioned this pull request Apr 4, 2024
@github-actions github-actions bot mentioned this pull request Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants