File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
src/content/docs/workers/static-assets Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,32 @@ assets = { directory = "./public/" }
3737
3838</WranglerConfig >
3939
40- ## ` binding `
40+ ### Ignoring assets
4141
42- Configuring the optional [ binding] ( /workers/runtime-apis/bindings ) gives you access to the collection of assets from within your Worker script.
42+ Sometime there are files in the asset directory that should not be uploaded.
43+
44+ In this case create a ` .assetsignore ` file in the root of the assets directory.
45+ This file takes the same format as ` .gitignore ` .
46+
47+ Wrangler will not upload asset files that match lines in this file.
48+
49+ ** Example**
4350
51+ You are migrating from a Pages project where the assets directory is ` dist ` .
52+ You do not want to upload the server-side Worker code nor Pages configuration files as public client-side assets.
53+ Add the following ` .assetsignore ` file:
4454
55+ ``` gitignore
56+ _worker.js
57+ _redirects
58+ _headers
59+ ```
60+
61+ Now Wrangler will not upload these files as client-side assets when deploying the Worker.
62+
63+ ## ` binding `
64+
65+ Configuring the optional [ binding] ( /workers/runtime-apis/bindings ) gives you access to the collection of assets from within your Worker script.
4566
4667<WranglerConfig >
4768
You can’t perform that action at this time.
0 commit comments