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

Run compatPrebuild in a separate output directory #2192

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

simonihmig
Copy link
Collaborator

@simonihmig simonihmig commented Dec 3, 2024

I was running into an issue where ember build being invoked as part of the compatPrebuild plugin and vite itself would both run on the same dist folder in conflicting ways. I believe ember build is cleaning up its output directory (dist by default) before running the build. Which already is causing some conflicts, as I think Vite should own that directory, and it may or may not do that cleanup itself depending on its emptyOutDir config.

I my case, the conflict was even larger as we were building to different targets inside of dist, like dist/test and dist/production (custom outDir vite config). These outputs were meant to persist, but when running the build in test mode first and then it production, the production build would make ember-cli clear dist/**, so after the build only dist/production is left.

const child = fork('./node_modules/ember-cli/bin/ember', ['build', '--environment', mode], { env });
const child = fork(
'./node_modules/ember-cli/bin/ember',
['build', '--environment', mode, '-o', 'tmp/compat-prebuild', '--suppress-sizes'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

--suppress-sizes is unrelated, but fixes getting the following red error message on production builds:

No asset files found in the path provided: dist/

@simonihmig simonihmig marked this pull request as ready for review December 5, 2024 11:36
@simonihmig
Copy link
Collaborator Author

Failing tests are also on main!

@simonihmig simonihmig requested a review from a team December 9, 2024 12:16
@ef4 ef4 merged commit 7afa1cc into main Dec 10, 2024
211 checks passed
@ef4 ef4 deleted the fix-compat-build-dist branch December 10, 2024 16:39
@github-actions github-actions bot mentioned this pull request Dec 10, 2024
@mansona mansona added the bug Something isn't working label Dec 10, 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.

None yet

3 participants