-
Notifications
You must be signed in to change notification settings - Fork 803
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
--minify
/config.minify
for scripts
#811
Conversation
🦋 Changeset detectedLatest commit: 0cfcd36 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 |
94fd7da
to
d56c43d
Compare
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/2177266299/npm-package-wrangler-811 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/811/npm-package-wrangler-811 Or you can use npx https://prerelease-registry.developers.workers.dev/runs/2177266299/npm-package-wrangler-811 dev path/to/script.js |
f73533a
to
14b601c
Compare
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.
This is a good start! Left some suggestions.
packages/wrangler/src/index.tsx
Outdated
}) | ||
.option("minify", { | ||
describe: "Utilize ESBuild minification on script", | ||
type: "boolean", |
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.
}) | |
.option("minify", { | |
describe: "Utilize ESBuild minification on script", | |
type: "boolean", |
no need to have this for preview
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.
Doesn't preview just use remote Dev? If we don't have parity with Dev
I think it would make more sense to just have it deprecated and give the user a message for the Dev
command
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.
That's what we currently do, but we don't want to introduce any new flags for this command (we already don't have all the flags from dev
)
14b601c
to
6f99186
Compare
b832338
to
780c985
Compare
e94e707
to
893f200
Compare
…ded to specific environments or inherited from top-level and flags --minify which will minify script for publish and remote Dev. Benefits: - The script minification will allow for more code to the edge while not reaching the 1MB limit. - Obfuscation of code in script. resolves #785
…ded to specific environments or inherited from top-level and flags --minify which will minify script for publish and remote Dev. Benefits: - The script minification will allow for more code to the edge while not reaching the 1MB limit. - Obfuscation of code in script. resolves #785
This was bothering me, so just a quick mechanical cleanup. In all the types we define, putting `| undefined` at the end instead of the beginning to be consistent.
f68c0ea
to
5e2867a
Compare
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.
some last nits
packages/wrangler/src/index.tsx
Outdated
@@ -732,6 +732,10 @@ export async function main(argv: string[]): Promise<void> { | |||
.option("experimental-enable-local-persistence", { | |||
describe: "Enable persistence for this session (only for local mode)", | |||
type: "boolean", | |||
}) | |||
.option("minify", { | |||
describe: "minify the script", |
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.
describe: "minify the script", | |
describe: "Minify the script", |
…ded to specific environments or inherited from top-level and flags --minify which will minify script for publish and remote Dev. Benefits: - The script minification will allow for more code to the edge while not reaching the 1MB limit. - Obfuscation of code in script. resolves #785
5e2867a
to
0cfcd36
Compare
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!
--minify
/config.minify
for scripts
feat: Added
minify
as a configuration option and a cli arg, which will minify code fordev
andpublish
resolves #785