Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def minify_js(js):
- """
- Basic minification of javascript code.
- Assumes no line comments and semi-colon delimited lines
- """
- return re.sub("[/][*][\s\S]*?[*][/]", "", # remove /**/ comments
- js.replace(" ", "").replace("\n", "") # remove 4 spaces and new lines (assume semicolons exist)
- )
Add Comment
Please, Sign In to add comment