Socket
Socket
Sign inDemoInstall

riot-compiler

Package Overview
Dependencies
8
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.3.1 to 3.4.0

6

CHANGELOG.md
# Compiler Changes
### v3.4.0
- Add inline sourcemap support via `sourcemap='inline'` option
### v3.3.1
- Improve the sourcemap generation adding the `sourceContent` key
### v3.3.0

@@ -4,0 +10,0 @@ - Add initial experimental sourcemaps support via `sourcemap: true` option

4

dist/es6.compiler.js
/**
* Compiler for riot custom tags
* @version v3.3.1
* @version v3.4.0
*/

@@ -850,3 +850,3 @@

var version = 'v3.3.1'
var version = 'v3.4.0'

@@ -853,0 +853,0 @@ export default {

@@ -275,3 +275,3 @@

* Compiler for riot custom tags
* @version v3.3.1
* @version v3.4.0
*/

@@ -854,3 +854,3 @@ var compile = (function () {

js: compileJS,
version: 'v3.3.1'
version: 'v3.4.0'
}

@@ -857,0 +857,0 @@ return compile

@@ -96,2 +96,4 @@ # Compiler

Using the `sourcemap='inline'` option, the compiler will return the compiled code appending inline the generated sourcemap
### <a name="css-parser"></a> compiler.parsers.css [tagName, css]

@@ -98,0 +100,0 @@

/**
* The riot-compiler v3.3.1
* The riot-compiler v3.4.0
*
* @module compiler
* @version v3.3.1
* @version v3.4.0
* @license MIT

@@ -988,8 +988,15 @@ * @copyright Muut Inc. + contributors

if (opts.sourcemap) {
var map = sourcemap({
source: src,
generated: output,
file: url
})
if (opts.sourcemap === 'inline') {
output += '\n' + sourcemap.toInlineComment(map)
return output
}
return {
map: sourcemap({
source: src,
generated: output,
file: url
}),
map: map,
code: output

@@ -1008,3 +1015,3 @@ }

parsers: parsers,
version: 'v3.3.1'
version: 'v3.4.0'
}

@@ -52,3 +52,3 @@ var SourceMapGenerator = require('source-map').SourceMapGenerator

*/
module.exports = function generate(opts) {
function generate(opts) {
var map = new SourceMapGenerator({

@@ -77,2 +77,17 @@ file: opts.file

return map
}
}
/**
* Generate inline sourcemap comment
* @param {SourceMapGenerator} map - SourceMapGenerator instance
* @returns {string} - sourcemap comment string
*/
function toInlineComment(map) {
const comment = '//# sourceMappingURL=data:application/json;charset=utf-8;base64,'
return `${comment}${new Buffer(map.toString()).toString('base64')}`
}
// generate inline comment from sourcemaps
generate.toInlineComment = toInlineComment
module.exports = generate
{
"name": "riot-compiler",
"version": "3.3.1",
"version": "3.4.0",
"description": "Compiler for riot .tag files",

@@ -5,0 +5,0 @@ "main": "lib/compiler.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc