版博士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.
 
 
 
 

57 lines
1.3 KiB

  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true});
  2. var _chunkG75WOS6Pjs = require('./chunk-G75WOS6P.js');
  3. // src/index.ts
  4. var _unplugin = require('unplugin');
  5. var _common = require('@vue-macros/common');
  6. function resolveOption(options) {
  7. const version = options.version || _common.detectVueVersion.call(void 0, );
  8. return {
  9. include: [_common.REGEX_SETUP_SFC],
  10. ...options,
  11. version
  12. };
  13. }
  14. var name = "unplugin-vue-setup-sfc";
  15. var src_default = _unplugin.createUnplugin.call(void 0,
  16. (userOptions = {}) => {
  17. const options = resolveOption(userOptions);
  18. const filter = _common.createFilter.call(void 0, options);
  19. return {
  20. name,
  21. enforce: "pre",
  22. transformInclude(id) {
  23. return filter(id);
  24. },
  25. transform(code, id) {
  26. return _chunkG75WOS6Pjs.transformSetupSFC.call(void 0, code, id);
  27. },
  28. vite: {
  29. config() {
  30. return {
  31. esbuild: {
  32. exclude: options.include,
  33. include: options.exclude
  34. }
  35. };
  36. },
  37. handleHotUpdate: (ctx) => {
  38. if (filter(ctx.file)) {
  39. return _chunkG75WOS6Pjs.hotUpdateSetupSFC.call(void 0, ctx, filter);
  40. }
  41. }
  42. }
  43. };
  44. }
  45. );
  46. exports.src_default = src_default;