You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
441 B

2 years ago
  1. 'use strict';
  2. const autoload = require('./../autoload');
  3. const basePath = require('./../path');
  4. let time = null;
  5. class CreatedComponentsPlugin {
  6. constructor() {}
  7. apply(compiler) {
  8. if (time) {
  9. clearTimeout(time);
  10. time = null;
  11. }
  12. time = setTimeout(() => {
  13. autoload.createAutoload(basePath.buildComponentsDirectory, ['vue'], 'array', 'Components');
  14. }, 30);
  15. }
  16. }
  17. module.exports = CreatedComponentsPlugin;