|
123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import {
- transformSetupBlock
- } from "./chunk-QAYSRE3T.mjs";
-
- // src/index.ts
- import { createUnplugin } from "unplugin";
- import {
- REGEX_SETUP_SFC,
- REGEX_VUE_SFC,
- createFilter,
- detectVueVersion
- } from "@vue-macros/common";
- function resolveOption(options) {
- const version = options.version || detectVueVersion();
- return {
- include: [REGEX_VUE_SFC, REGEX_SETUP_SFC],
- defaultLang: "ts",
- ...options,
- version
- };
- }
- var name = "unplugin-vue-setup-block";
- var src_default = createUnplugin(
- (userOptions = {}) => {
- const options = resolveOption(userOptions);
- const filter = createFilter(options);
- return {
- name,
- enforce: "pre",
- transformInclude(id) {
- return filter(id);
- },
- transform(code, id) {
- return transformSetupBlock(code, id, options.defaultLang);
- }
- };
- }
- );
-
- export {
- src_default
- };
|