Skip to content

Instantly share code, notes, and snippets.

@Zielak
Created March 8, 2015 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zielak/c8c918fb9ad38fc94eaa to your computer and use it in GitHub Desktop.
Save Zielak/c8c918fb9ad38fc94eaa to your computer and use it in GitHub Desktop.
Make source maps work in Windows. Temporary fix
var os = require('os');
var fs = require('fs');
// Change the project name to match yours
// Find it in your flow file
// project.app.name = ?
var projectName = 'grayscale';
exports.hook = function(flow, done) {
if(os.type() == 'Windows_NT') {
// Check folders
// /bin first
fs.exists('bin/web/bin/', function (exists) {
if(!exists) fs.mkdirSync('bin/web/bin/');
fs.exists('bin/web/bin/web/', function (exists) {
if(!exists) fs.mkdirSync('bin/web/bin/web/');
// Copy file
fs.writeFileSync('bin/web/bin/web/'+projectName+'.js.map', fs.readFileSync('bin/web/'+projectName+'.js.map'));
});
});
}
done();
} //hook
{
project : {
// ...
build : {
dependencies : {
luxe : '*',
},
post : {
name: 'source map fix',
script: 'hook.post.js',
desc: 'haxe does something bad with source maps in Windows'
}
},
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment