Created
March 8, 2015 22:39
-
-
Save Zielak/c8c918fb9ad38fc94eaa to your computer and use it in GitHub Desktop.
Make source maps work in Windows. Temporary fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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