Skip to content

Omit files from public directory in Worker builds#8091

Merged
petebacondarwin merged 3 commits intomainfrom
james/omit-public-directory
Feb 11, 2025
Merged

Omit files from public directory in Worker builds#8091
petebacondarwin merged 3 commits intomainfrom
james/omit-public-directory

Conversation

@jamesopstad
Copy link
Copy Markdown
Contributor

Fixes #[000].

Omit files from public directory in Worker builds


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: N/A
  • Wrangler E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: N/A
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: N/A

@jamesopstad jamesopstad requested a review from a team February 11, 2025 10:55
@jamesopstad jamesopstad requested a review from a team as a code owner February 11, 2025 10:55
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 11, 2025

🦋 Changeset detected

Latest commit: cd9eb62

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/vite-plugin Patch

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

@jamesopstad jamesopstad added the vite-plugin Relating to the `@cloudflare/vite-plugin` package label Feb 11, 2025
// We need to enable `emitAssets` in order to support additional modules defined by `rules`
emitAssets: true,
outDir: getOutputDirectory(userConfig, environmentName),
copyPublicDir: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not wanted when we are assets-only, right?
But then createCloudflareEnvironmentOptions() is not called in that case, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is no Worker environment when it's assets only, just the client environment.

@github-actions
Copy link
Copy Markdown
Contributor

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-wrangler-8091

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8091/npm-package-wrangler-8091

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-wrangler-8091 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-workers-bindings-extension-8091 -O ./cloudflare-workers-bindings-extension.0.0.0-v82e6ecb1e.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v82e6ecb1e.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-create-cloudflare-8091 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-kv-asset-handler-8091

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-miniflare-8091

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-pages-shared-8091

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-unenv-preset-8091

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-vite-plugin-8091

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-vitest-pool-workers-8091

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-workers-editor-shared-8091

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-workers-shared-8091

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13261299800/npm-package-cloudflare-workflows-shared-8091

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.107.3 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250129.0
workerd 1.20250204.0 1.20250204.0
workerd --version 1.20250204.0 2025-02-04

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@petebacondarwin petebacondarwin merged commit 9a3d525 into main Feb 11, 2025
@petebacondarwin petebacondarwin deleted the james/omit-public-directory branch February 11, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vite-plugin Relating to the `@cloudflare/vite-plugin` package

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants