save-remote-file-webpack-plugin
Advanced tools
Comparing version 1.0.2 to 1.1.0
# SaveRemoteFilePlugin webpack plugin Changelog | ||
## 1.1.0 - 2020-03-29 | ||
### Added | ||
* Added 'hash' option to specify whether the plugin adds content hashes to output filenames. | ||
## 1.0.2 - 2018-10-22 | ||
@@ -4,0 +8,0 @@ ### Changed |
@@ -42,3 +42,3 @@ 'use strict'; | ||
var hash = crypto.createHash('md5').update(data).digest("hex"); | ||
var newPath = _this.appendHashToPath(option.filepath, hash); | ||
var newPath = option.hash === false ? option.filepath : _this.appendHashToPath(option.filepath, hash); | ||
compilation.assets[newPath] = { | ||
@@ -45,0 +45,0 @@ size: function size() { |
{ | ||
"name": "save-remote-file-webpack-plugin", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "webpack 4 plugin to download & save remote files locally", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -47,3 +47,4 @@ # SaveRemoteFilePlugin webpack plugin | ||
* **url** remote URL of the remote file to save locally | ||
* **filepath** filename where the file will be saved, relative to your webpack `output.path` | ||
* **url** - remote URL of the remote file to save locally | ||
* **filepath** - filename where the file will be saved, relative to your webpack `output.path` | ||
* **hash** - [boolean] whether to add a content hash to the output filename. (default: `true`) |
@@ -34,3 +34,3 @@ const crypto = require('crypto'); | ||
const hash = crypto.createHash('md5').update(data).digest("hex"); | ||
const newPath = this.appendHashToPath(option.filepath, hash); | ||
const newPath = (option.hash === false) ? option.filepath : this.appendHashToPath(option.filepath, hash); | ||
compilation.assets[newPath] = { | ||
@@ -37,0 +37,0 @@ size: () => data.length, |
50
13798
7