-
Notifications
You must be signed in to change notification settings - Fork 334
Allow users to customize wrangler build
step
#820
Comments
Feature request from #778:
|
bug report from #428
|
This would be super helpful for my use case as well. I proposed a "pre-publish" command in #1224 but customizing the build process in general would definitely accomplish the same end-goal: Overview and problem statementI think it'd be helpful for us Workers Sites users if In my case I'm using Jekyll to generate the static files prior to publishing with wrangler. When running Basic exampleIn [site]
bucket = "./_site"
entry-point = "workers-site"
pre-publish = "jekyll build --config ./jekyll-production-config.yml" Thank you! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bump. |
Our use-case: we have a monorepo containing a number of different workers plus packages with shared worker code:
We use a yarn workspace and We can't use this suggestion to include an empty |
You can get this working good ol' "hacky way":
{
"scripts": {
"build:a": "cd packages/worker-library-1 && mkdir node_modules && wrangler dev",
"build:b": "cd packages/worker-library-2 && mkdir node_modules && wrangler dev",
"cleanup": "rm packages/worker-library-1/node_modules packages/worker-library-1/node_modules"
}
If you take a look at |
@nataliescottdavidson you are aware you can make a load of devs happy and resolve most of the monorepo issues (especially for nx users) by simply introducing in the |
In that case, I could probably also do this:
|
yeah sure, you can persist this change. I would not recommend that as this can confuse other devs but maybe that is just me ;-) |
looking forward to #1748, would allow me to share code between my web app, API, and the cloudflare Workers Site project that hosts my company's web app! We use a |
Keep in mind that there are some limitations to this PR. You need to have "webpack.config.json" file present in the dir you want to build a worker. There is still a bit of work to be done to make this CLI "monorepo friendly" but its a step in the right direction. I hope it will work for you - if you encounter any problems you can always PM me and will try to progress this further. |
closing since this is addressed by #1677, which will be going out as part of an RC in the near future |
Today, Wrangler is rather prescriptive about what happens during the build stage; this works relatively well for Rust projects in particular, but begins to cause headaches for more complex javascript/webpack work flows. We should provide and document some way for users to customize their build step.
Related issues:
wrangler publish
withoutnpm install
#778The text was updated successfully, but these errors were encountered: