@vue-macros/short-vmodel
Version:
shortVmodel feature from Vue Macros.
46 lines (43 loc) • 980 B
JavaScript
import {
transformShortVmodel
} from "./chunk-DJAUYXSA.js";
// src/index.ts
import { getVuePluginApi } from "@vue-macros/common";
var name = "unplugin-vue-short-vmodel";
function rollup(options = {}) {
let api;
return {
name,
configResolved(config) {
try {
api = getVuePluginApi(config.plugins);
} catch {
}
},
buildStart(rollupOpts) {
if (api === void 0)
try {
api = getVuePluginApi(rollupOpts.plugins);
} catch (error) {
this.warn(error);
return;
}
if (!api) return;
api.options.template ||= {};
api.options.template.compilerOptions ||= {};
api.options.template.compilerOptions.nodeTransforms ||= [];
api.options.template.compilerOptions.nodeTransforms.push(
transformShortVmodel(options)
);
}
};
}
var plugin = {
rollup,
rolldown: rollup,
vite: rollup
};
var index_default = plugin;
export {
index_default
};