2019-11-21 22:22:33 +03:00
|
|
|
const util = require('util');
|
|
|
|
const cpx = require("cpx");
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
let rawdata = fs.readFileSync('package.json');
|
|
|
|
let packageJson = JSON.parse(rawdata);
|
|
|
|
|
|
|
|
Object.keys(packageJson.dependencies).forEach(function (packageName) {
|
|
|
|
cpx.copy(
|
|
|
|
util.format("node_modules/%s/**", packageName),
|
2020-04-28 15:46:51 +03:00
|
|
|
util.format("assets/%s", packageName),
|
2019-11-21 22:22:33 +03:00
|
|
|
function(err){
|
|
|
|
if(err) {
|
|
|
|
console.log(util.format("cpx error for %s: %s", packageName, err));
|
|
|
|
process.exit(1);
|
|
|
|
} else {
|
|
|
|
console.log(util.format("copied %s to assets", packageName));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|