file-loader
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.1.5"></a> | ||
## [1.1.5](https://github.com/webpack/file-loader/compare/v1.1.4...v1.1.5) (2017-10-05) | ||
### Bug Fixes | ||
* **schema:** allow `name` to be a `{Function}` (`options.name`) ([#216](https://github.com/webpack/file-loader/issues/216)) ([fbfb160](https://github.com/webpack/file-loader/commit/fbfb160)) | ||
<a name="1.1.4"></a> | ||
@@ -7,0 +17,0 @@ ## [1.1.4](https://github.com/webpack/file-loader/compare/v1.1.3...v1.1.4) (2017-09-30) |
{ | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"name": {}, | ||
"regExp": {}, | ||
@@ -8,0 +6,0 @@ "context": { |
{ | ||
"name": "file-loader", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "file loader module for webpack", |
@@ -60,3 +60,3 @@ [![npm][npm]][npm-url] | ||
|:--:|:--:|:-----:|:----------| | ||
|**`name`**|`{String}`|`[hash].[ext]`|Configure a custom filename template for your file| | ||
|**`name`**|`{String\|Function}`|`[hash].[ext]`|Configure a custom filename template for your file| | ||
|**`context`**|`{String}`|`this.options.context`|Configure a custom file context, defaults to `webpack.config.js` [context](https://webpack.js.org/configuration/entry-context/#context)| | ||
@@ -72,2 +72,4 @@ |**`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| | ||
#### `{String}` | ||
**webpack.config.js** | ||
@@ -83,2 +85,20 @@ ```js | ||
#### `{Function}` | ||
**webpack.config.js** | ||
```js | ||
{ | ||
loader: 'file-loader', | ||
options: { | ||
name (file) { | ||
if (env === 'development') { | ||
return '[path][name].[ext]' | ||
} | ||
return '[hash].[ext]' | ||
} | ||
} | ||
} | ||
``` | ||
#### `placeholders` | ||
@@ -129,3 +149,3 @@ | ||
name: '[path][name].[ext]', | ||
publicPath: 'assets' | ||
publicPath: 'assets/' | ||
} | ||
@@ -143,3 +163,3 @@ } | ||
name: '[path][name].[ext]', | ||
outputPath: 'images' | ||
outputPath: 'images/' | ||
} | ||
@@ -146,0 +166,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19175
308
82