-
Notifications
You must be signed in to change notification settings - Fork 735
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
feat: --no-build
#1300
feat: --no-build
#1300
Conversation
🦋 Changeset detectedLatest commit: 3c58ea4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2576137124/npm-package-wrangler-1300 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1300/npm-package-wrangler-1300 Or you can use npx https://prerelease-registry.developers.workers.dev/runs/2576137124/npm-package-wrangler-1300 dev path/to/script.js |
Hi, I like this functionality. I have some workers that are just a simple javascript file and I like having them uploaded as-is. My question though is, would it be possible for this to be a One of the struggles I came across as well as the file being built unnecessarily before upload was using Thanks! |
This is exactly the kind of feedback I was looking for, thank you very much! We could probably do it for dev as well, as well as being able to specify it in wrangler.toml. |
Sounds good! |
--do-not-build
--no-build
b7968ce
to
6e56de8
Compare
I've renamed it to Opened this up for review. |
type: "string", | ||
requiresArg: true, | ||
}) | ||
// We want to have a --no-build flag, but yargs requires that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lolwtf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
computers sigh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just some merge conflicts
This adds a `--no-build` flag to `wrangler publish`. We've had a bunch of people asking to be able to upload a worker directly, without any modifications. While there are tradeoffs to this approach (any linked modules etc won't work), we understand that people who need this functionality are aware of it (and the usecases that have presented themselves all seem to match this).
"no build" is actually a bad name for this flag, since "build" refers to custom builds, and this would imply that it wouldn't run custom builds. Will change this to a different name before releasing today. Open to suggestions. no-bundle? raw-publish? |
Of those two, I prefer I also don't have a better idea myself. |
|
Aight, let's go with |
As a configuration parallel to `--no-bundle` (introduced in #1300 as `--no-build`, renamed in #1399 to `--no-bundle`), this introduces a configuration field `no_bundle` to prevent bundling of the worker before it's published. It's inheritable, which means it can be defined inside environments as well.
I had been following his, hoping for an actual However, what if I really wanted My reasons basically mirror what's in cloudflare/wrangler-legacy#2219. I have CI building and testing from an existing webpack build, and for efficiency and consistency, I want to treat my built JavaScript as an "immutable" artifact that I can deploy as is. This is especially important as I redeploy the same script across multiple environments and because build inputs like environment variables could change the contents of our built script. |
@wuservices we're separately working on "versioning" which should (theoretically) let you do reverts to a previously deployed version. I think that would be a proper solution here, instead of a "no-build" solution. Alternately, as we're building a first class api to manipulate wrangler, you may be able to wire this up yourself on the future. |
Of course, another option is to not use the [build] field, and just manually run your build step yourself before running publish/dev. |
@threepointone the ability to revert could certainly be helpful, but it wouldn't fit into our current TeamCity CI workflow as naturally as being able to retrigger a previous deployment that completed successfully. That's workable though. However, if you had multiple separate environments (or zones or accounts), versioning wouldn't allow you to deploy the exact same code everywhere. However, it sounds like getting creative to avoid the |
This adds a
--no-build
flag towrangler publish
andwrangler dev
. We've had a bunch of people asking to be able to upload a worker directly, without any modifications. While there are tradeoffs to this approach (any linked modules etc won't work), we understand that people who need this functionality are aware of it (and the usecases that have presented themselves all seem to match this).Disable whitespace changes for this review!