-
-
Notifications
You must be signed in to change notification settings - Fork 256
docs(README): add regExp
option (options.regExp
)
#244
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@serut Thx in advance
README.md
Outdated
@@ -197,6 +198,25 @@ import img from './file.png' | |||
`${publicPath}/0dcbbaa701328e351f.png` | |||
``` | |||
|
|||
### `regExp` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this after name
README.md
Outdated
|**`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)| | ||
|**`regExp`**|`{RegExp}`|`'undefined'`|Let you extract some parts of the file path to reuse them in the `name` property| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this after name
README.md
Outdated
@@ -106,7 +107,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}`, with `N` `{Number}` >0 |``|The `n-th` match obtained from matching the current file name against the `regExp`| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is actually a {String}
e.g '4'
instead of a {Number}
, that should be sufficient for the type column imho. You could add a note in the description that N should be > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No you need to write [4]
, [
and ]
decorates the number. And explaining why N is a number > 0 is quite long and already explained on the regExp option. Maybe a link above "N
{Number}
>0"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk, just {String}
then please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oki that's not big deal
} | ||
} | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The interpolated name here ...
regExp
option (options.regExp
)
@michael-ciniawsky friendly ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@serut Thx
Hello,
This PR describes the behavior of
regExp
and how to use it.I've also fix :
[N]
, hope this doesn't alter too much your table layout.Hope you will like it. 😄