Skip to content

Commit a1321c8

Browse files
committed
update docs
1 parent 76b71f1 commit a1321c8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • webpack/set-webpack-public-path-plugin

webpack/set-webpack-public-path-plugin/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,25 @@ import { SetPublicPathPlugin } from '@microsoft/set-webpack-public-path-plugin';
2828

2929
#### `scriptName = { }`
3030

31-
This parameter is an object that takes two properties: a string property `name`, and a boolean property `isTokenized`.
31+
This parameter is an object that takes three properties: a string property `name`, a boolean property `isTokenized`,
32+
and a boolean property `useAssetName`
33+
3234
The `name` property is a regular expression string that is applied to all script URLs on the page. The last directory
3335
of the URL that matches the regular expression is used as the public path. For example, if the `name` property
3436
is set to `my\-bundle_?[a-zA-Z0-9-_]*\.js` and a script's URL is `https://mycdn.net/files/build_id/assets/my-bundle_10fae182eb.js`,
3537
the public path will be set to `https://mycdn.net/files/build_id/assets/`.
3638

37-
If the `isTokenized` paramter is set to `true`, the regular expression string in `name` is treated as a tokenized
39+
If the `isTokenized` parameter is set to `true`, the regular expression string in `name` is treated as a tokenized
3840
string. The supported tokens are `[name]` and `[hash]`. Instances of the `[name]` substring are replaced with the
3941
chunk's name, and instances of the `[hash]` substring are replaced with the chunk's rendered hash. The name
4042
is regular expression-escaped. For example, if the `name` property is set to `[name]_?[a-zA-Z0-9-_]*\.js`,
4143
`isTokenized` is set to `true`, and the chunk's name is `my-bundle`, and a script's URL is
4244
`https://mycdn.net/files/build_id/assets/my-bundle_10fae182eb.js`, the public path will be set to
4345
`https://mycdn.net/files/build_id/assets/`.
4446

47+
If the `useAssetName` property is set, the plugin will use the Webpack-produced asset name as it would the `name`
48+
property. `useAssetName` is exclusive to `name` and `isTokenized`.
49+
4550
This option is exclusive to other options. If it is set, `systemJs`, `publicPath`, and `urlPrefix` will be ignored.
4651

4752
#### `systemJs = true`

0 commit comments

Comments
 (0)