plugin.js 542 B

1234567891011121314151617181920
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const util_1 = require("./util");
  4. const NS = 'vue-loader';
  5. class Plugin {
  6. apply(compiler) {
  7. let Ctor;
  8. if ((0, util_1.testWebpack5)(compiler)) {
  9. // webpack5 and upper
  10. Ctor = require('./pluginWebpack5').default;
  11. }
  12. else {
  13. // webpack4 and lower
  14. Ctor = require('./pluginWebpack4').default;
  15. }
  16. new Ctor().apply(compiler);
  17. }
  18. }
  19. Plugin.NS = NS;
  20. exports.default = Plugin;