assets-webpack-plugin
Advanced tools
Comparing version 3.8.3 to 3.8.4-alpha.0
@@ -13,2 +13,8 @@ # Change Log | ||
## 3.8.4 - 2018-06-20 | ||
### Changed | ||
- No code changed. Purely for testing tagged releases on git. | ||
## 3.8.3 - 2018-06-18 | ||
@@ -15,0 +21,0 @@ |
@@ -5,2 +5,4 @@ 'use strict'; | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var merge = require('lodash.merge'); | ||
@@ -119,3 +121,8 @@ | ||
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) { | ||
@@ -122,0 +129,0 @@ compilation.errors.push(err); |
@@ -7,6 +7,4 @@ 'use strict'; | ||
var mkdirp = require('mkdirp'); | ||
var merge = require('lodash.merge'); | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var merge = require('lodash.merge'); | ||
@@ -32,3 +30,2 @@ var error = require('../utils/error'); | ||
module.exports = function (options) { | ||
var outputPath = path.join(options.path, options.filename); | ||
var update = options.update; | ||
@@ -41,10 +38,14 @@ var firstRun = true; | ||
return function writeOutput(newAssets, next) { | ||
// if potions.update is false and we're on the first pass of a (possibly) multicompiler | ||
return function writeOutput(fs, newAssets, next) { | ||
// if options.update is false and we're on the first pass of a (possibly) multicompiler | ||
var overwrite = !update && firstRun; | ||
var absolutePath = path.resolve(options.path); | ||
mkdirp(options.path, function (err) { | ||
fs.mkdirp(absolutePath, 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) { | ||
@@ -51,0 +52,0 @@ // if file does not exist, just write data to it |
@@ -20,3 +20,3 @@ "use strict"; | ||
if (next) { | ||
processor(next.data, iterator(next.callback)); | ||
processor(next.fs, next.data, iterator(next.callback)); | ||
} | ||
@@ -26,11 +26,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)); | ||
} | ||
}; | ||
}; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,1 +1,3 @@ | ||
var fs = require('fs') | ||
var path = require('path') | ||
var merge = require('lodash.merge') | ||
@@ -114,3 +116,8 @@ | ||
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) { | ||
@@ -117,0 +124,0 @@ compilation.errors.push(err) |
{ | ||
"name": "assets-webpack-plugin", | ||
"version": "3.8.3", | ||
"version": "3.8.4-alpha.0", | ||
"description": "Emits a json file with assets paths", | ||
@@ -14,3 +14,3 @@ "main": "dist/index.js", | ||
"type": "git", | ||
"url": "https://github.com/kossnocorp/assets-webpack-plugin.git" | ||
"url": "https://github.com/ztoben/assets-webpack-plugin.git" | ||
}, | ||
@@ -27,5 +27,5 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/kossnocorp/assets-webpack-plugin/issues" | ||
"url": "https://github.com/ztoben/assets-webpack-plugin/issues" | ||
}, | ||
"homepage": "https://github.com/kossnocorp/assets-webpack-plugin", | ||
"homepage": "https://github.com/ztoben/assets-webpack-plugin", | ||
"files": [ | ||
@@ -41,3 +41,3 @@ "index.js", | ||
"css-loader": "^0.28.11", | ||
"lodash": "^3.9.3", | ||
"lodash": "^4.17.10", | ||
"mini-css-extract-plugin": "^0.4.0", | ||
@@ -44,0 +44,0 @@ "mocha": "^5.2.0", |
# assets-webpack-plugin | ||
[![Build Status](https://travis-ci.org/kossnocorp/assets-webpack-plugin.svg?branch=master)](https://travis-ci.org/kossnocorp/assets-webpack-plugin) [![Build status](https://ci.appveyor.com/api/projects/status/qmvi3h6lk0xu8833?svg=true)](https://ci.appveyor.com/project/kossnocorp/assets-webpack-plugin) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
[![npm package](https://img.shields.io/npm/v/assets-webpack-plugin.svg?style=flat)](https://www.npmjs.org/package/assets-webpack-plugin) | ||
[![Build Status](https://travis-ci.org/ztoben/assets-webpack-plugin.svg?branch=master)](https://travis-ci.org/ztoben/assets-webpack-plugin) | ||
[![Build status](https://ci.appveyor.com/api/projects/status/sbchndv12vk45mo3?svg=true)](https://ci.appveyor.com/project/ztoben/assets-webpack-plugin) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/ztoben/assets-webpack-plugin.svg)](https://greenkeeper.io/) | ||
@@ -4,0 +8,0 @@ Webpack plugin that emits a json file with assets paths. |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
34660
511
286
1
2