版博士V2.0程序
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.
 
 
 
 

42 lines
839 B

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