版博士V2.0程序
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

64 řádky
1.7 KiB

  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true});
  2. var _chunkQVCPMPXJjs = require('./chunk-QVCPMPXJ.js');
  3. // src/index.ts
  4. var _unplugin = require('unplugin');
  5. var _common = require('@vue-macros/common');
  6. var _api = require('@vue-macros/api');
  7. function resolveOptions(options, framework) {
  8. const version = options.version || _common.detectVueVersion.call(void 0, );
  9. return {
  10. include: [_common.REGEX_VUE_SFC, _common.REGEX_SETUP_SFC].concat(
  11. version === 2 && framework === "webpack" ? _common.REGEX_VUE_SUB : []
  12. ),
  13. isProduction: process.env.NODE_ENV === "production",
  14. ...options,
  15. version
  16. };
  17. }
  18. var name = "unplugin-vue-better-define";
  19. var src_default = _unplugin.createUnplugin.call(void 0,
  20. (userOptions = {}, { framework }) => {
  21. const options = resolveOptions(userOptions, framework);
  22. const filter = _common.createFilter.call(void 0, options);
  23. const { resolve, handleHotUpdate } = _api.RollupResolve.call(void 0, );
  24. return {
  25. name,
  26. enforce: "pre",
  27. buildStart() {
  28. if (framework === "rollup" || framework === "vite") {
  29. _api.setResolveTSFileIdImpl.call(void 0, resolve(this));
  30. }
  31. },
  32. transformInclude(id) {
  33. return filter(id);
  34. },
  35. async transform(code, id) {
  36. try {
  37. return await _chunkQVCPMPXJjs.transformBetterDefine.call(void 0, code, id, options.isProduction);
  38. } catch (err) {
  39. this.warn(`${name} ${err}`);
  40. console.warn(err);
  41. }
  42. },
  43. vite: {
  44. configResolved(config) {
  45. options.isProduction = config.isProduction;
  46. },
  47. handleHotUpdate
  48. }
  49. };
  50. }
  51. );
  52. exports.src_default = src_default;