You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
545 B
21 lines
545 B
let fs = require('fs') |
|
|
|
function embedJs(src, dst) { |
|
fs.readFile(src, 'utf8', function(err, data) { |
|
if(err) throw err; |
|
|
|
data = data.replace(/\\"/g, '\\\\"'); |
|
data = "(<any>window)['"+src.replace(/^.*[\\\/]/, '')+"'] = `" + data + "`;"; |
|
|
|
fs.writeFile(dst, data, function(err) { |
|
if(err) throw err; |
|
}); |
|
}); |
|
} |
|
|
|
let toolsDir = __dirname; |
|
let dataDir = toolsDir + "/../data"; |
|
let srcDir = toolsDir + "/../src"; |
|
let intermediateDir = toolsDir + "/../.intermediate"; |
|
|
|
embedJs(intermediateDir+'/app.js', intermediateDir+'/app.js.ts');
|
|
|