common-shakeify
Advanced tools
Comparing version 0.2.0 to 0.3.0
11
index.js
@@ -5,5 +5,10 @@ 'use strict' | ||
const transformAst = require('transform-ast') | ||
const wrapComment = require('wrap-comment') | ||
const through = require('through2') | ||
module.exports = function commonShake (b, opts) { | ||
if (typeof b !== 'object') { | ||
throw new Error('common-shakeify: must be used as a plugin, not a transform') | ||
} | ||
const basedir = b._options.basedir || process.cwd() | ||
@@ -125,8 +130,4 @@ const seen = {} | ||
function commentify (str) { | ||
return `/* common-shake removed: ${safeComment(str)} */` | ||
return wrapComment(`common-shake removed: ${str}`) | ||
} | ||
function safeComment (str) { | ||
return str.replace(/\*\//g, '*\\/') | ||
} | ||
} |
{ | ||
"name": "common-shakeify", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "browserify tree shaking plugin using @indutny common-shake", | ||
@@ -27,3 +27,4 @@ "main": "index.js", | ||
"through2": "^2.0.3", | ||
"transform-ast": "^2.1.0" | ||
"transform-ast": "^2.1.0", | ||
"wrap-comment": "^1.0.0" | ||
}, | ||
@@ -30,0 +31,0 @@ "devDependencies": { |
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
20340
41
393
4
+ Addedwrap-comment@^1.0.0
+ Addedwrap-comment@1.0.1(transitive)