From 99a715efb19f71f16a9d09f0042701588a9d7ec8 Mon Sep 17 00:00:00 2001 From: jpic Date: Sun, 10 Feb 2019 20:18:14 +0100 Subject: [PATCH] Fix #18: fix demo Note that we also need to add to our webpack.config.js:: resolve: { alias: { '.': path.resolve(__dirname, '__target__') }, extensions: ['.js', '.py'] } --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 5fcb9e6..5dd64e8 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ module.exports = function (source) { const compilers = { transcrypt: { switches: '-b -n -m', - folder: `.${slash}__javascript__`, + folder: `.${slash}__target__`, install: 'pip install transcrypt', python_version: '3.x', sourcemaps: true, @@ -121,10 +121,10 @@ module.exports = function (source) { } if (compiler.sourcemaps) { - const sourceMapFile = `${srcDir}${slash}${compiler.folder}${slash}extra${slash}sourcemap${slash}${basename}.js`; - sourceMap = fs.readFileSync(sourceMapFile + ".map", "utf8") + const sourceMapFile = `${srcDir}${slash}${compiler.folder}${slash}${basename}.map`; + sourceMap = fs.readFileSync(sourceMapFile, "utf8") if (!compiler.keep_compiled) { - fs.unlinkSync(sourceMapFile + ".map"); + fs.unlinkSync(sourceMapFile); } callback(null, js, sourceMap); }