版博士V2.0程序
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

59 linhas
1.6 KiB

  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true});
  2. var _chunkOZQFJBTFjs = require('./chunk-OZQFJBTF.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 resolveOption(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-single-define";
  19. var src_default = _unplugin.createUnplugin.call(void 0,
  20. (userOptions = {}, { framework }) => {
  21. const options = resolveOption(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. transform(code, id) {
  36. return _chunkOZQFJBTFjs.transformDefineSingle.call(void 0, code, id, options.isProduction);
  37. },
  38. vite: {
  39. configResolved(config) {
  40. options.isProduction = config.isProduction;
  41. },
  42. handleHotUpdate
  43. }
  44. };
  45. }
  46. );
  47. exports.src_default = src_default;