phaser/v3/create-checksum.js

28 lines
540 B
JavaScript
Raw Normal View History

var fs = require('fs-extra');
var uuid = require('uuid');
var v = uuid.v1();
var output = [
'var CHECKSUM = {',
2017-08-16 13:12:58 +00:00
' build: \'' + v + '\'',
'};',
'module.exports = CHECKSUM;'
];
// Should output a json file, but webpack2 json-loader is broken
// at the moment, so we're outputting a js file instead
2017-08-16 13:12:58 +00:00
fs.writeFile('./src/checksum.js', output.join('\n'), { encoding: 'utf8', flag: 'w' }, function (error) {
if (error)
{
throw error;
}
else
{
console.log('Building #' + v);
}
});