fix: respect function build.path during build and run#7161
Merged
isaacroldan merged 1 commit intomainfrom Apr 2, 2026
Merged
Conversation
Contributor
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Avoid unnecessary rebundling when a function's custom build.path stays under the default dist directory, and make the function runner execute the configured build.path directly. Add regression tests for both behaviors. Co-authored-by: Claude Code <claude-code@anthropic.com>
7f3ec5b to
cf64354
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes function build/run behavior to correctly respect build.path and avoids unnecessary WASM rebundling when the custom path remains in the default output directory.
Changes:
- Update
shopify app function runto resolve the WASM file path frombuild.pathwhen configured. - Skip the base64 rebundle step when
build.pathis in the same directory as the default output path. - Add tests covering both the rebundle-skip behavior and the runner’s
build.pathresolution.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/app/src/cli/services/function/runner.ts | Resolve function WASM path from configuration.build.path (fallback to outputPath) before invoking the runner binary. |
| packages/app/src/cli/services/function/runner.test.ts | Add coverage ensuring the runner uses the configured build.path. |
| packages/app/src/cli/services/build/extension.ts | Avoid calling bundleFunctionExtension when custom build.path stays in the default output directory. |
| packages/app/src/cli/services/build/extension.test.ts | Add coverage ensuring no rebundling occurs for same-directory build.path overrides. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
craigmichaelmartin
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
When a function extension defines a custom
build.path(e.g.dist/custom.wasm) that stays in the same directory as the default output path (dist/index.wasm), the build process was unnecessarily rebundling (base64-encoding) the wasm file. Additionally,shopify app function runwas not respecting the configuredbuild.path, always using the defaultoutputPathinstead.WHAT is this pull request doing?
extension.ts(build):dirnamecheck so that whenbuild.pathresolves to the same directory as the default output path, the redundant rebundle step is skipped.runner.ts(run):getFunctionPath()helper that resolves the function wasm path frombuild.pathconfig when present, falling back to the defaultoutputPath.Tests:
build.pathstays in the default output directory.build.pathwhen configured.How to test your changes?
build.pathinshopify.function.extension.toml:shopify app build— verify no unnecessary base64 rebundling occurs.shopify app function run— verify it executes the correct wasm file.Measuring impact
Checklist