var fs = require('fs'); var logger = require('console'); module.exports = function(context) { var Q = context.requireCordovaModule('q'); var deferral = new Q.defer(); logger.log('copy-ff-spa-loader-css start'); fs.readFile('../../es5-ff-spa-loader.css',function(err,data) { if (err) { return deferral.reject(err); } fs.writeFile('www/es5-ff-spa-loader.css',data,function(err) { if (err) { return deferral.reject(err); } logger.log('copy-ff-spa-loader-css done'); deferral.resolve(); }) }); return deferral.promise; }