babel-transform-roll20
Advanced tools
Comparing version 0.5.0 to 0.6.0
{ | ||
"name": "babel-transform-roll20", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "A babel transform tool for transpiling scripts for the Roll20 sandbox.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -9,3 +9,5 @@ const babelParser = require('@babel/parser') | ||
module.exports = function roll20Transform ({ types: t }) { | ||
function getFileContents (filePath, roots) { | ||
function getFileContents (file, roots) { | ||
const filePath = `${file.dir}/${file.base}${file.ext && file.base.endsWith(file.ext) ? '' : '.js'}` | ||
try { | ||
@@ -43,3 +45,3 @@ const file = fs.readFileSync(filePath, { | ||
if (!program.__visited_files[filePath]) { | ||
let fileContents = getFileContents(`${file.dir}/${file.base}${file.ext && file.base.endsWith(file.ext) ? '' : '.js'}`, program.__roots) | ||
let fileContents = getFileContents(file, program.__roots) | ||
@@ -155,3 +157,3 @@ switch (file.ext) { | ||
const moduleName = getModule(path) | ||
const exportName = `__export__${moduleName.slice(1, -1).replace(/[/-.]/g, '_')}` | ||
const exportName = `__export__${moduleName.slice(1, -1).replace(/[./-]/g, '_')}` | ||
@@ -158,0 +160,0 @@ exportBlock.__exports[exportName] = true |
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
24126
740