完成ci优化

This commit is contained in:
Harvey Zack committed 2018-11-30 17:25:48 +08:00
1 parent 848c6ab131
commit 00ea9c4ca4
23 files changed
+94 -306

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
const cpy = require('cpy');
module.exports = (opts = {}) => ({
name: 'copyAfterBuild',
generateBundle(outputOptions, bundle, isWrite) {
if (!isWrite) {
throw new Error('copyAfterBuild currently only works with bundles that are written to disk');
}
if (opts.from && opts.to) {
cpy(opts.from, opts.to).then(() => {
console.log('File copy succeeded!');
}).catch(() => {
throw new Error('File copy failed!');
});
}
},
});