Completely updated React, fixed #11, (hopefully)
This commit is contained in:
34
goTorrentWebUI/node_modules/file-loader/README.md
generated
vendored
34
goTorrentWebUI/node_modules/file-loader/README.md
generated
vendored
@@ -58,9 +58,10 @@ Emits `file.png` as file in the output directory and returns the public URL
|
||||
|Name|Type|Default|Description|
|
||||
|:--:|:--:|:-----:|:----------|
|
||||
|**`name`**|`{String\|Function}`|`[hash].[ext]`|Configure a custom filename template for your file|
|
||||
|**`regExp`**|`{RegExp}`|`'undefined'`|Let you extract some parts of the file path to reuse them in the `name` property|
|
||||
|**`context`**|`{String}`|`this.options.context`|Configure a custom file context, defaults to `webpack.config.js` [context](https://webpack.js.org/configuration/entry-context/#context)|
|
||||
|**`publicPath`**|`{String\|Function}`|[`__webpack_public_path__ `](https://webpack.js.org/api/module-variables/#__webpack_public_path__-webpack-specific-)|Configure a custom `public` path for your files|
|
||||
|**`outputPath`**|`{String\|Function}`|`'undefined'`|Configure a custom `output` path for your files|
|
||||
|**`publicPath`**|`{String\|Function}`|[`__webpack_public_path__ `](https://webpack.js.org/api/module-variables/#__webpack_public_path__-webpack-specific-)|Configure a custom `public` path for your file|
|
||||
|**`outputPath`**|`{String\|Function}`|`'undefined'`|Configure a custom `output` path for your file|
|
||||
|**`useRelativePath`**|`{Boolean}`|`false`|Should be `true` if you wish to generate a `context` relative URL for each file|
|
||||
|**`emitFile`**|`{Boolean}`|`true`|By default a file is emitted, however this can be disabled if required (e.g. for server side packages)|
|
||||
|
||||
@@ -98,6 +99,29 @@ You can configure a custom filename template for your file using the query param
|
||||
}
|
||||
```
|
||||
|
||||
### `regExp`
|
||||
|
||||
Defines a `regExp` to match some parts of the file path. These capture groups can be reused in the `name` property using `[N]` placeholder. Note that `[0]` will be replaced by the entire tested string, whereas `[1]` will contain the first capturing parenthesis of your regex and so on...
|
||||
|
||||
```js
|
||||
import img from './customer01/file.png'
|
||||
```
|
||||
|
||||
**webpack.config.js**
|
||||
```js
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
regExp: /\/([a-z0-9]+)\/[a-z0-9]+\.png$/,
|
||||
name: '[1]-[name].[ext]'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
customer01-file.png
|
||||
```
|
||||
|
||||
#### `placeholders`
|
||||
|
||||
|Name|Type|Default|Description|
|
||||
@@ -106,7 +130,7 @@ You can configure a custom filename template for your file using the query param
|
||||
|**`[name]`**|`{String}`|`file.basename`|The basename of the resource|
|
||||
|**`[path]`**|`{String}`|`file.dirname`|The path of the resource relative to the `context`|
|
||||
|**`[hash]`**|`{String}`|`md5`|The hash of the content, hashes below for more info|
|
||||
|**`[N]`**|`{Number}`|``|The `n-th` match obtained from matching the current file name against the query param `regExp`|
|
||||
|**`[N]`**|`{String}`|``|The `n-th` match obtained from matching the current file name against the `regExp`|
|
||||
|
||||
#### `hashes`
|
||||
|
||||
@@ -115,8 +139,8 @@ You can configure a custom filename template for your file using the query param
|
||||
|Name|Type|Default|Description|
|
||||
|:--:|:--:|:-----:|:----------|
|
||||
|**`hashType`**|`{String}`|`md5`|`sha1`, `md5`, `sha256`, `sha512`|
|
||||
|**`digestType`**|`{String}`|`base64`|`hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`|
|
||||
|**`length`**|`{Number}`|`8`|The length in chars|
|
||||
|**`digestType`**|`{String}`|`hex`|`hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`|
|
||||
|**`length`**|`{Number}`|`9999`|The length in chars|
|
||||
|
||||
By default, the path and name you specify will output the file in that same directory and will also use that same URL path to access the file.
|
||||
|
||||
|
Reference in New Issue
Block a user