Closed gerriet-hinrichs closed 4 years ago
Due to the way the splitting after minification works, some required semicolons are removed, giving invalid css as the result.
Code to reproduce:
const { minifyHTMLLiterals } = require('minify-html-literals'); const assert = require('assert'); const source = ` const fontSize = '12px'; const style = css\` body { font-size: \${fontSize}; font-color: black; }\`; `; const expected = ` const fontSize = '12px'; const style = css\`body{font-size:\${fontSize};font-color:#000}\`; `; const result = minifyHTMLLiterals(source, { fileName: 'test.js' }); console.log(result.code); // the semicolon after the ${fontSize} template part gets removed during splitting assert(source == expected);
Fixed in https://github.com/asyncLiz/minify-html-literals/pull/22
Due to the way the splitting after minification works, some required semicolons are removed, giving invalid css as the result.
Code to reproduce: