版博士V2.0程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

45 righe
978 B

  1. import {
  2. transformExportProps
  3. } from "./chunk-MBDL57TK.mjs";
  4. // src/index.ts
  5. import { createUnplugin } from "unplugin";
  6. import {
  7. REGEX_SETUP_SFC,
  8. REGEX_VUE_SFC,
  9. REGEX_VUE_SUB,
  10. createFilter,
  11. detectVueVersion
  12. } from "@vue-macros/common";
  13. function resolveOption(options, framework) {
  14. const version = options.version || detectVueVersion();
  15. return {
  16. include: [REGEX_VUE_SFC, REGEX_SETUP_SFC].concat(
  17. version === 2 && framework === "webpack" ? REGEX_VUE_SUB : []
  18. ),
  19. ...options,
  20. version
  21. };
  22. }
  23. var name = "unplugin-vue-export-props";
  24. var src_default = createUnplugin(
  25. (userOptions = {}, { framework }) => {
  26. const options = resolveOption(userOptions, framework);
  27. const filter = createFilter(options);
  28. return {
  29. name,
  30. enforce: "pre",
  31. transformInclude(id) {
  32. return filter(id);
  33. },
  34. transform(code, id) {
  35. return transformExportProps(code, id);
  36. }
  37. };
  38. }
  39. );
  40. export {
  41. src_default
  42. };