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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions packages/vite/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@ export function emberBuild(command: string, mode: string, resolvableExtensions:

if (command === 'build') {
return new Promise((resolve, reject) => {
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/

{ env }
);
child.on('exit', code => (code === 0 ? resolve() : reject()));
});
}
return new Promise((resolve, reject) => {
const child = fork('./node_modules/ember-cli/bin/ember', ['build', '--watch', '--environment', mode], {
silent: true,
env,
});
const child = fork(
'./node_modules/ember-cli/bin/ember',
['build', '--watch', '--environment', mode, '-o', 'tmp/compat-prebuild', '--suppress-sizes'],
{
silent: true,
env,
}
);
child.on('exit', code => (code === 0 ? resolve() : reject(new Error('ember build --watch failed'))));
child.on('spawn', () => {
child.stderr?.on('data', data => {
Expand Down
Loading