Comparing version 0.0.3 to 0.0.4
@@ -6,9 +6,7 @@ var uglifycss = require('uglifycss'); | ||
var reg_log = /_log\(.+?\)/g; | ||
module.exports = { | ||
js: function uglify(str, opt) { | ||
// remove debug info by default | ||
str = str.replace(opt && opt.removals || reg_log, ''); | ||
if (opt) delete opt.removals; | ||
if (opt && opt.filter) { | ||
str = opt.filter(str); | ||
} | ||
var ast = jsp.parse(str); | ||
@@ -20,5 +18,4 @@ ast = pro.ast_mangle(ast); | ||
css: function uglifycss(str, opt) { | ||
if (opt && opt.removals) { | ||
str.replace(opt.removals, ''); | ||
delete opt.removals; | ||
if (opt && opt.filter) { | ||
str = opt.filter(str); | ||
} | ||
@@ -25,0 +22,0 @@ return uglifycss.processString(str, opt); |
{ | ||
"name": "istatic", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"homepage": "http://github.com/ktmud/express-istatic", | ||
"description": "Add compressed inline css and scripts to your html, but write them as seperated files.", | ||
"keywords": [ "express", "static files include", "compression", "minify" ], | ||
"contributors": [ | ||
"ktmud <jyyjcc@gmail.com> (http://ktmud.com)" | ||
], | ||
"author": "ktmud <jyyjcc@gmail.com> (http://ktmud.com)", | ||
"main": "./lib/istatic", | ||
@@ -14,3 +12,3 @@ "repository": "git@github.com/ktmud/express-istatic.git", | ||
"less": ">= 1.0", | ||
"stylus": ">= 1.0", | ||
"stylus": ">= 0.1", | ||
"uglify-js": ">= 1.0", | ||
@@ -17,0 +15,0 @@ "uglifycss": ">= 0.0.5" |
@@ -52,6 +52,4 @@ # Inline Static Files for express / connect / nodejs | ||
For css and js options, you can define an `js.removals` or `css.removals`, to remove some contents (like `console.log()`) before compressing. This will make the inline css/script even more smaller, but still keep the maitainability of the code. | ||
For css and js options, you can define an `js.filter` or `css.filter`, to do some filtering(like remove `console.log()`) before compressing. | ||
By default, there's only `removals` for js, and it's an RegExp: ``/_log\(.+?\)/g``. | ||
## Use inside template: | ||
@@ -58,0 +56,0 @@ |
11173
138
150
+ Added@adobe/css-tools@4.3.3(transitive)
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedms@2.1.3(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedsource-map@0.7.4(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedstylus@0.64.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
Updatedstylus@>= 0.1