Skip to content

Commit

Permalink
allow specifying only "index" without extension or nothing at all to …
Browse files Browse the repository at this point in the history
…launch "wrangler dev" (#196)

* change entryPoint === entry to entryPoint === Object.keys(result.metafile.inputs)[0]

* changeset added

* changed to patch

* added change for publish as well

* Update loud-dolls-pay.md

Co-authored-by: Sunil Pai <[email protected]>
  • Loading branch information
jgentes and threepointone authored Jan 14, 2022
1 parent 18f8f65 commit fc112d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-dolls-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

allow specifying only "index" without extension or nothing at all for "wrangler dev" and "wrangler publish"
3 changes: 2 additions & 1 deletion packages/wrangler/src/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@ function useEsbuild(props: {
});

const chunks = Object.entries(result.metafile.outputs).find(
([_path, { entryPoint }]) => entryPoint === entry
([_path, { entryPoint }]) =>
entryPoint === Object.keys(result.metafile.inputs)[0]
); // assumedly only one entry point

setBundle({
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default async function publish(props: Props): Promise<void> {
entryPoint ===
(props.public
? path.join(path.dirname(file), "static-asset-facade.js")
: file)
: Object.keys(result.metafile.inputs)[0])
);

const { format } = props;
Expand Down

0 comments on commit fc112d7

Please sign in to comment.