unminified-webpack-plugin
Advanced tools
Comparing version 1.3.0 to 1.4.0
10
index.js
@@ -45,5 +45,13 @@ const webpack = require('webpack'); | ||
const finalFiles = files.filter(ModuleFilenameHelpers.matchObject.bind(null, options)); | ||
const bannerPlugin = compiler.options.plugins.find(plugin => plugin.constructor.name === 'BannerPlugin'); | ||
finalFiles.forEach(file => { | ||
const asset = compilation.assets[file]; | ||
const source = asset.source(); | ||
let matchedBanners = []; | ||
if (bannerPlugin) { | ||
matchedBanners = [file].filter(ModuleFilenameHelpers.matchObject.bind(null, bannerPlugin.options)); | ||
} | ||
const source = matchedBanners.length ? bannerPlugin.banner + asset.source() : asset.source(); | ||
compilation.assets[getFileName(file, path.extname(file).substr(1), options)] = { | ||
@@ -50,0 +58,0 @@ source: () => source, |
{ | ||
"name": "unminified-webpack-plugin", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "A `webpack` plugin for generating un-minified JavaScript files along with UglifyJsPlugin.", | ||
@@ -12,4 +12,4 @@ "main": "index.js", | ||
], | ||
"engines" : { | ||
"node" : ">=8.0.0" | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
@@ -16,0 +16,0 @@ "repository": { |
@@ -59,4 +59,2 @@ unminified-webpack-plugin | ||
**Note:** Does not work with `BannerPlugin`, see [this comment](https://github.com/leftstick/unminified-webpack-plugin/issues/1#issuecomment-226413904) for an explanation. | ||
## Configuration ## | ||
@@ -63,0 +61,0 @@ |
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
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
7844
53
108