-
Notifications
You must be signed in to change notification settings - Fork 673
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
Remove src
directory and already-bundled dependencies from published package
#3013
Comments
On further inspection, it turns out we mostly already do only include externalized dependencies within our On the bright side, we're already doing the right thing, so GO TEAM! 🥳 Sorry for the false alarm, and h/t @petebacondarwin for calling attention to the quick savings we could gain by removing |
I think xxhash-wasm is still needed as a dependency for now. It is used to create a hash key for "Workers Sites" uploads. But once we move over to Pages based asset uploads, this can go. |
Thanks @1000hz for enlightening me about how xxhash-wasm has the WASM module inlined in the JS module! So indeed it is already bundled. |
If we ship the JS API and want to provide I'm a pretty big +1 to doing this! It can make using a package so much easier. |
Prevents the following being included in the npm tarball: - `src`: we may want to ship this if we shipped source maps, so users could click on internal lines in stack traces, but we don't ship source maps to npm, so these aren't needed. - `miniflare-config-stubs`: these aren't used as of #633 (https://github.com/cloudflare/workers-sdk/pull/633/files#diff-dd2c9d6fc577a3da1b7cf0b6b4a0705a1c71eb5d99c372d5bdda99476362f975L97-L102) - `vendor`: this directory doesn't actually exist in the `wrangler` package directory, there is a root `vendor` directory, but files from that are copied to `wrangler-dist` during build Closes #3013
Prevents the following being included in the npm tarball: - `src`: we may want to ship this if we shipped source maps, so users could click on internal lines in stack traces, but we don't ship source maps to npm, so these aren't needed. - `miniflare-config-stubs`: these aren't used as of #633 (https://github.com/cloudflare/workers-sdk/pull/633/files#diff-dd2c9d6fc577a3da1b7cf0b6b4a0705a1c71eb5d99c372d5bdda99476362f975L97-L102) - `vendor`: this directory doesn't actually exist in the `wrangler` package directory, there is a root `vendor` directory, but files from that are copied to `wrangler-dist` during build Closes #3013
Closed by #3191 |
Prevents the following being included in the npm tarball: - `src`: we may want to ship this if we shipped source maps, so users could click on internal lines in stack traces, but we don't ship source maps to npm, so these aren't needed. - `miniflare-config-stubs`: these aren't used as of #633 (https://github.com/cloudflare/workers-sdk/pull/633/files#diff-dd2c9d6fc577a3da1b7cf0b6b4a0705a1c71eb5d99c372d5bdda99476362f975L97-L102) - `vendor`: this directory doesn't actually exist in the `wrangler` package directory, there is a root `vendor` directory, but files from that are copied to `wrangler-dist` during build Closes #3013
Prevents the following being included in the npm tarball: - `src`: we may want to ship this if we shipped source maps, so users could click on internal lines in stack traces, but we don't ship source maps to npm, so these aren't needed. - `miniflare-config-stubs`: these aren't used as of #633 (https://github.com/cloudflare/workers-sdk/pull/633/files#diff-dd2c9d6fc577a3da1b7cf0b6b4a0705a1c71eb5d99c372d5bdda99476362f975L97-L102) - `vendor`: this directory doesn't actually exist in the `wrangler` package directory, there is a root `vendor` directory, but files from that are copied to `wrangler-dist` during build Closes #3013
We currently include the
src
directory in the published artifact, resulting in an extra 2.6 MB on disk.Additionally, although we bundle the application into
wrangler-dist/cli.js
, we publishpackage.json
still declaringdependencies
on those bundled libraries, resulting in an additional 32 MB of packages getting installed even though they've already been included in the bundle.In order to minimize installation time of wrangler, we should consider removing
src
from the published artifact and either moving bundled dependencies todevDependencies
or publishing with a stripped downpackage.json
that only includes withindependencies
any externalized modules. This becomes more important as we start depending on larger external modules (e.g.workerd
) and need to keep time-to-install within reasonable bounds.The text was updated successfully, but these errors were encountered: