assets-webpack-plugin
Advanced tools
Comparing version 3.6.0 to 3.6.1
@@ -13,2 +13,8 @@ # Change Log | ||
## 3.6.1 - 2018-06-02 | ||
### Changed | ||
- webpack-dev-server (which uses memory-fs) correctly generates the manifest inside the memory file system (kudos to [@Kronuz](https://github.com/Kronuz) see [#90](https://github.com/kossnocorp/assets-webpack-plugin/pull/90)) | ||
## 3.6.0 - 2018-05-29 | ||
@@ -15,0 +21,0 @@ |
11
index.js
@@ -0,1 +1,3 @@ | ||
var fs = require('fs') | ||
var path = require('path') | ||
var merge = require('lodash.merge') | ||
@@ -64,3 +66,3 @@ | ||
var typeName = getAssetKind(options, asset) | ||
typeMap[typeName] = assetPath + asset | ||
typeMap[typeName] = path.join(assetPath, asset) | ||
@@ -92,3 +94,8 @@ return typeMap | ||
self.writer(output, function (err) { | ||
if (!compiler.outputFileSystem.readFile) { | ||
compiler.outputFileSystem.readFile = fs.readFile.bind(fs) | ||
compiler.outputFileSystem.join = path.join.bind(path) | ||
} | ||
self.writer(compiler.outputFileSystem, output, function (err) { | ||
if (err) { | ||
@@ -95,0 +102,0 @@ compilation.errors.push(err) |
@@ -1,4 +0,1 @@ | ||
var mkdirp = require('mkdirp') | ||
var path = require('path') | ||
var fs = require('fs') | ||
var merge = require('lodash.merge') | ||
@@ -9,3 +6,2 @@ | ||
module.exports = function (options) { | ||
var outputPath = path.join(options.path, options.filename) | ||
var update = options.update | ||
@@ -18,10 +14,13 @@ var firstRun = true | ||
return function writeOutput (newAssets, next) { | ||
return function writeOutput (fs, newAssets, next) { | ||
// if potions.update is false and we're on the first pass of a (possibly) multicompiler | ||
var overwrite = !update && firstRun | ||
mkdirp(options.path, function (err) { | ||
fs.mkdirp(options.path, function (err) { | ||
if (err) { | ||
return next(error('Could not create output folder ' + options.path, err)) | ||
} | ||
var outputPath = fs.join(options.path, options.filename) | ||
fs.readFile(outputPath, 'utf8', function (err, data) { | ||
@@ -28,0 +27,0 @@ // if file does not exist, just write data to it |
@@ -18,3 +18,3 @@ /** | ||
if (next) { | ||
processor(next.data, iterator(next.callback)) | ||
processor(next.fs, next.data, iterator(next.callback)) | ||
} | ||
@@ -24,11 +24,11 @@ } | ||
return function queuedWriter (data, callback) { | ||
return function queuedWriter (fs, data, callback) { | ||
var empty = !queue.length | ||
queue.push({data: data, callback: callback}) | ||
queue.push({fs: fs, data: data, callback: callback}) | ||
if (empty) { | ||
// start processing | ||
processor(data, iterator(callback)) | ||
processor(fs, data, iterator(callback)) | ||
} | ||
} | ||
} |
{ | ||
"name": "assets-webpack-plugin", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"description": "Emits a json file with assets paths", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
49910
42
946
1