copy-plugins.js 456 B

12345678910111213141516171819202122
  1. /**
  2. * @description 有些依赖需要手动添加,防止复制粘贴
  3. * @author lvkun
  4. */
  5. const { resolve } = require("path");
  6. const fs = require("fs");
  7. const sorcePath = "src/static";
  8. const targetPath = './dist/static'
  9. fs.mkdirSync(resolve(targetPath));
  10. const files = fs.readdirSync(`./${sorcePath}`);
  11. files.forEach( file => {
  12. const _file = fs.readFileSync(resolve(sorcePath, file));
  13. fs.writeFileSync(resolve(targetPath, file), file);
  14. })