unminified-webpack-plugin
Advanced tools
Comparing version 1.0.1 to 1.1.0
13
index.js
'use strict'; | ||
var webpack = require('webpack'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var mkdirp = require('mkdirp'); | ||
var resolve = path.resolve; | ||
var ModuleFilenameHelpers = require('webpack/lib/ModuleFilenameHelpers'); | ||
var getFileName = function(name) { | ||
var getFileName = function(name, opts) { | ||
var minIndex = name.indexOf('min'); | ||
@@ -16,7 +12,8 @@ if (minIndex > -1) { | ||
} | ||
var nonmin = opts.postfix || 'nomin'; | ||
var jsIndex = name.indexOf('js'); | ||
if (jsIndex > -1) { | ||
return name.substring(0, jsIndex - 1) + '.nomin.js'; | ||
return name.substring(0, jsIndex - 1) + '.' + nonmin + '.js'; | ||
} | ||
return name + 'nomin.js'; | ||
return name + nonmin + '.js'; | ||
}; | ||
@@ -54,3 +51,3 @@ | ||
var asset = compilation.assets[file]; | ||
compilation.assets[getFileName(file)] = { | ||
compilation.assets[getFileName(file, options)] = { | ||
source: function() { | ||
@@ -57,0 +54,0 @@ return asset.source(); |
{ | ||
"name": "unminified-webpack-plugin", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A `webpack` plugin for generating un-minified JavaScript files along with UglifyJsPlugin.", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"del": "^2.2.0", | ||
"del": "^2.2.1", | ||
"mocha": "^2.5.3", | ||
@@ -30,0 +30,0 @@ "webpack": "^1.13.1" |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
3909
54