@riotjs/compiler
Advanced tools
Comparing version 4.2.0 to 4.2.1
# Compiler Changes | ||
### v4.2.1 | ||
- Fix css generation with `@media` queries | ||
### v4.2.0 | ||
@@ -4,0 +7,0 @@ - Add support for `<a {href}/>` shortcut expressions |
{ | ||
"name": "@riotjs/compiler", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "Compiler for riot .tag files", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,2 +7,9 @@ import {builders, types} from '../../utils/build-types' | ||
/** | ||
* Matches valid, multiline JavaScript comments in almost all its forms. | ||
* @const {RegExp} | ||
* @static | ||
*/ | ||
const R_MLCOMMS = /\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//g | ||
/** | ||
* Source for creating regexes matching valid quoted, single-line JavaScript strings. | ||
@@ -68,2 +75,14 @@ * It recognizes escape characters, including nested quotes and line continuation. | ||
/** | ||
* Remove comments, compact and trim whitespace | ||
* @param {RiotParser.Node} cssNode - css node | ||
* @returns {RiotParser.Node} css node normalized | ||
*/ | ||
function compactCss(cssNode) { | ||
return { | ||
...cssNode, | ||
text: cssNode.text.replace(R_MLCOMMS, '').replace(/\s+/g, ' ').trim() | ||
} | ||
} | ||
/** | ||
* Generate the component css | ||
@@ -79,3 +98,3 @@ * @param { Object } sourceNode - node generated by the riot compiler | ||
const { options } = meta | ||
const cssNode = sourceNode.text | ||
const cssNode = compactCss(sourceNode.text) | ||
const preprocessorOutput = preprocess('css', preprocessorName, meta, cssNode) | ||
@@ -82,0 +101,0 @@ const cssCode = (options.scopedCss ? |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1261592
32415