merge-jsons-webpack-plugin
Advanced tools
Comparing version 1.0.8 to 1.0.9
22
index.js
@@ -12,3 +12,3 @@ "use strict"; | ||
compiler.plugin('emit', (compilation, done) => { | ||
console.log('MergetJsonsWebpackPlugin emit...'); | ||
console.log('MergetJsonsWebpackPlugin compilation started...'); | ||
let files = this.options.files; | ||
@@ -23,5 +23,3 @@ let output = this.options.output; | ||
let outputPath = output.fileName; | ||
this.processFiles(compilation, files, outputPath).then((result) => { | ||
done(); | ||
}); | ||
this.processFiles(compilation, files, outputPath).then((result) => { done(); }); | ||
} | ||
@@ -36,11 +34,21 @@ else if (groupBy) { | ||
this._glob(pattern).then((files) => { | ||
this.processFiles(compilation, files, outputPath).then((result) => { | ||
done(); | ||
}); | ||
this.processFiles(compilation, files, outputPath).then((result) => { done(); }); | ||
}); | ||
}); | ||
} | ||
console.log('MergetJsonsWebpackPlugin compilation completed...'); | ||
}); | ||
compiler.plugin("after-emit", (compilation, callback) => { | ||
console.log("MergetJsonsWebpackPlugin emit starts..."); | ||
if (this.fileDependencies != null) { | ||
this.fileDependencies.forEach((f) => { | ||
compilation.fileDependencies.push(path.join(compiler.context, f)); | ||
}); | ||
} | ||
console.log("MergetJsonsWebpackPlugin emit completed..."); | ||
callback(); | ||
}); | ||
}; | ||
this.processFiles = (compilation, files, outputPath) => { | ||
this.fileDependencies = files; | ||
var fileContents = files.map(this.readFile); | ||
@@ -47,0 +55,0 @@ let mergedContents = {}; |
{ | ||
"name": "merge-jsons-webpack-plugin", | ||
"description": "This plugin is used to merge json files into single json file,using glob or file names", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "email": "sudharsan_tk@yahoo.co.in", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24364
144
0