From 23a71a901189c62a3cfc2ded759f777ac5851260 Mon Sep 17 00:00:00 2001 From: Robert Gruber Date: Wed, 9 Nov 2016 16:36:26 +0100 Subject: [PATCH 1/2] Do not write polyfills to non js sources By checking the file extension we can ensure there is no polyfill added to a file not containing `js`. Think of a `css`-file (if extracted). --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index bdbe44f..d369223 100644 --- a/index.js +++ b/index.js @@ -23,6 +23,9 @@ PolyfillsPlugin.prototype.apply = function(compiler) { chunks.forEach(function(chunk) { if(!chunk.initial) return; chunk.files.forEach(function(file, i) { + if (!file.endsWith('.js')) { + return; + } compilation.assets[file] = new ConcatSource("/* Polyfills */\n", filesContent, compilation.assets[file]); }); }); From 8b138f71b31bd01211051a1f62c79882005693d0 Mon Sep 17 00:00:00 2001 From: Robert Gruber Date: Wed, 9 Nov 2016 16:41:15 +0100 Subject: [PATCH 2/2] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 04cd410..0c471b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack-polyfills-plugin", - "version": "0.0.9", + "version": "0.0.10", "description": "Adds polyfills to bundle file, without magic.", "main": "index.js", "scripts": {