aboutsummaryrefslogtreecommitdiff
path: root/node_modules/html-webpack-plugin/lib
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/html-webpack-plugin/lib
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/html-webpack-plugin/lib')
-rw-r--r--node_modules/html-webpack-plugin/lib/chunksorter.js24
-rw-r--r--node_modules/html-webpack-plugin/lib/loader.js2
2 files changed, 24 insertions, 2 deletions
diff --git a/node_modules/html-webpack-plugin/lib/chunksorter.js b/node_modules/html-webpack-plugin/lib/chunksorter.js
index 584e01ccb..75f1a11a6 100644
--- a/node_modules/html-webpack-plugin/lib/chunksorter.js
+++ b/node_modules/html-webpack-plugin/lib/chunksorter.js
@@ -81,6 +81,28 @@ module.exports.none = function (chunks) {
};
/**
+ * Sort manually by the chunks
+ * @param {Array} chunks the chunks to sort
+ * @return {Array} The sorted chunks
+ */
+module.exports.manual = function (chunks, specifyChunks) {
+ var chunksResult = [];
+ var filterResult = [];
+ if (Array.isArray(specifyChunks)) {
+ for (var i = 0; i < specifyChunks.length; i++) {
+ filterResult = chunks.filter(function (chunk) {
+ if (chunk.names[0] && chunk.names[0] === specifyChunks[i]) {
+ return true;
+ }
+ return false;
+ });
+ filterResult.length > 0 && chunksResult.push(filterResult[0]);
+ }
+ }
+ return chunksResult;
+};
+
+/**
* Defines the default sorter.
*/
module.exports.auto = module.exports.id;
@@ -88,6 +110,6 @@ module.exports.auto = module.exports.id;
// In webpack 2 the ids have been flipped.
// Therefore the id sort doesn't work the same way as it did for webpack 1
// Luckily the dependency sort is working as expected
-if (require('webpack/package.json').version.split('.')[0] === '2') {
+if (Number(require('webpack/package.json').version.split('.')[0]) > 1) {
module.exports.auto = module.exports.dependency;
}
diff --git a/node_modules/html-webpack-plugin/lib/loader.js b/node_modules/html-webpack-plugin/lib/loader.js
index e1af5e513..6b8bd0d8e 100644
--- a/node_modules/html-webpack-plugin/lib/loader.js
+++ b/node_modules/html-webpack-plugin/lib/loader.js
@@ -17,7 +17,7 @@ module.exports = function (source) {
return source;
}
// Skip .js files
- if (/\.js$/.test(this.request)) {
+ if (/\.js$/.test(this.resourcePath)) {
return source;
}