webpack-webfont
Advanced tools
Comparing version 0.0.1-alpha.8 to 0.0.1-alpha.9
@@ -7,2 +7,6 @@ # Change Log | ||
# 0.0.1.-alpha.9 - 2017-08-29 | ||
- Fixed: infinite recompilation. | ||
# 0.0.1.-alpha.8 - 2017-08-29 | ||
@@ -9,0 +13,0 @@ |
@@ -13,2 +13,6 @@ "use strict"; | ||
var _glob = require("glob"); | ||
var _glob2 = _interopRequireDefault(_glob); | ||
var _globParent = require("glob-parent"); | ||
@@ -49,3 +53,4 @@ | ||
this.options = Object.assign({}, options); | ||
this.fileDependencies = []; | ||
this.skip = false; | ||
this.destFilename = null; | ||
} | ||
@@ -58,2 +63,7 @@ | ||
compiler.plugin("invalid", function (filename) { | ||
var srcFiles = _glob2.default.sync(this.options.files); | ||
this.skip = filename === this.destFilename || srcFiles.indexOf(filename) === -1; | ||
}); | ||
compiler.plugin("run", function (compilation, callback) { | ||
@@ -63,2 +73,8 @@ return _this.compile(callback); | ||
compiler.plugin("watch-run", function (compilation, callback) { | ||
if (_this.skip) { | ||
_this.skip = false; | ||
return callback(); | ||
} | ||
return _this.compile(callback); | ||
@@ -109,12 +125,11 @@ }); | ||
var content = result[type]; | ||
var destFilename = null; | ||
if (type !== "styles") { | ||
destFilename = _path2.default.resolve(_path2.default.join(dest, fontName + "." + type)); | ||
_this2.destFilename = _path2.default.resolve(_path2.default.join(dest, fontName + "." + type)); | ||
} else { | ||
destFilename = _path2.default.resolve(destStyles); | ||
_this2.destFilename = _path2.default.resolve(destStyles); | ||
} | ||
return new Promise(function (resolve, reject) { | ||
_fsExtra2.default.outputFile(destFilename, content, function (error) { | ||
_fsExtra2.default.outputFile(_this2.destFilename, content, function (error) { | ||
if (error) { | ||
@@ -121,0 +136,0 @@ return reject(new Error(error)); |
{ | ||
"name": "webpack-webfont", | ||
"version": "0.0.1-alpha.8", | ||
"version": "0.0.1-alpha.9", | ||
"description": "Webpack plugin for webfont package", | ||
@@ -51,6 +51,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"webfont": "^7.0.0", | ||
"fs-extra": "^4.0.0", | ||
"glob": "^7.1.2", | ||
"glob-parent": "^3.1.0", | ||
"nodeify": "^1.0.0", | ||
"glob-parent": "^3.1.0" | ||
"webfont": "^7.0.0" | ||
}, | ||
@@ -57,0 +58,0 @@ "devDependencies": { |
16384
118
5
+ Addedglob@^7.1.2