Skip to content

Commit

Permalink
Fix martim00#18: fix demo
Browse files Browse the repository at this point in the history
Note that we also need to add to our webpack.config.js::

    resolve: {
        alias: {
            '.': path.resolve(__dirname, '__target__')
        },
        extensions: ['.js', '.py']
    }
  • Loading branch information
jpic committed Feb 10, 2019
1 parent cfa1b03 commit 99a715e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 99a715e

Please sign in to comment.