UNPKG

livescript-jest

Version:

A preprocessor to help use LiveScript with Jest

19 lines (17 loc) 396 B
var livescript = require('livescript'); compileOptions = { bare: true, map: "embedded" } module.exports = { process: function(src, path) { if (path.match(/\.ls$/)) { let compiledObject = livescript.compile(src, {...compileOptions, filename: path}); return { code: compiledObject.code, map: compiledObject.map.toString() } } return src; } };