Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/snap2js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ async function saveToFile(filename, opts, logger) {

logger.debug('compiling ' + filename + ' to ' + outfile);
const fn = await compileFile(filename, opts, logger);
const relPath = path.resolve(`${path.dirname(__dirname)}/src/context/${context}`);
const relPath = path.resolve(path.join(path.dirname(__dirname), 'src', 'context', context));
const contextPath = path.relative(path.resolve(opts.output), relPath);
const code = `(${fn.toString()})(require('./${contextPath}'))`;
const code = `(${fn.toString()})(require('./${contextPath.replace(/\\/g, "\\\\")}'))`;
await writeFile(tmpfile, code);

const b = browserify([tmpfile], BROWSERIFY_OPTS);
Expand Down