var fs = require('fs'); module.exports = function(context) { var Q = context.requireCordovaModule('q'); var deferral = new Q.defer(); console.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); console.log('copy-ff-spa-loader-css done'); deferral.resolve(); }) }); return deferral.promise; }