You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: website/docs/en/config/dev/asset-prefix.mdx
+6
Original file line number
Diff line number
Diff line change
@@ -122,3 +122,9 @@ The differences from the native configuration are as follows:
122
122
-`dev.assetPrefix` default value is the same as [server.base](/config/server/base).
123
123
-`dev.assetPrefix` automatically appends a trailing `/` by default.
124
124
- The value of `dev.assetPrefix` is written to the [process.env.ASSET_PREFIX](/guide/advanced/env-vars#processenvasset_prefix) environment variable (can only be accessed in client code).
125
+
126
+
## Dynamic asset prefix
127
+
128
+
Use the `__webpack_public_path__` variable provided by Rspack to dynamically set the URL prefix of static assets in JavaScript code.
129
+
130
+
See [Rspack - Dynamically set publicPath](https://rspack.dev/config/output#dynamically-set-publicpath).
Copy file name to clipboardexpand all lines: website/docs/en/config/output/asset-prefix.mdx
+6
Original file line number
Diff line number
Diff line change
@@ -89,3 +89,9 @@ The differences from the native configuration are as follows:
89
89
-`output.assetPrefix` default value is the same as [server.base](/config/server/base).
90
90
-`output.assetPrefix` automatically appends a trailing `/` by default.
91
91
- The value of `output.assetPrefix` is written to the [process.env.ASSET_PREFIX](/guide/advanced/env-vars#processenvasset_prefix) environment variable (can only be accessed in client code).
92
+
93
+
## Dynamic asset prefix
94
+
95
+
Use the `__webpack_public_path__` variable provided by Rspack to dynamically set the URL prefix of static assets in JavaScript code.
96
+
97
+
See [Rspack - Dynamically set publicPath](https://rspack.dev/config/output#dynamically-set-publicpath).
0 commit comments