auth0 / webtask-bundle

Module and CLI to bundle your code for use on https://webtask.io
28 stars 6 forks source link

Support ignoring (not removing) certain comments with the minifier #19

Closed sgmeyer closed 7 years ago

sgmeyer commented 8 years ago

I have a large webtask that exceeds the maximum file size, mainly due to some ejs templates. I can't minify the webtask because I am using heredoc for my ejs templates.

function view() { /*

*/ }

Once minified the view is gone. I tried /*! to tell the minifier to keep the comment block. Is there a way to tell the minifier leave some comments alone?

ggoodman commented 7 years ago

@sgmeyer would you be willing to try with ES2015 Template Literals (aka backticks `) instead of heredocs?

Example:

const tpl = `
<h1>Hello world</h1>
`;

Supporting a variety of different compilation / transpilation permutations and combinations is unsustainable, so we prefer to stick with a very simple subset.

sgmeyer commented 7 years ago

@ggoodman yup I can do that. I will also go through our sample rules and fix those examples too. I think a few of them are already using heredoc.