UNPKG

@vue-macros/test-utils

Version:

Test utilities for Vue Macros.

58 lines (56 loc) 1.62 kB
// src/index.ts import { removeSpaces, RollupEscapeNullCharacterPlugin as RollupEscapeNullCharacterPlugin2, RollupToStringPlugin, testFixtures, testFixturesSkip } from "@sxzz/test-utils"; // src/rollup.ts import { rollupBuild as _rollupBuild, RollupEscapeNullCharacterPlugin } from "@sxzz/test-utils"; import ViteVueJsx from "@vitejs/plugin-vue-jsx"; import { Oxc } from "unplugin-oxc"; import { default as default2 } from "unplugin-vue/rollup"; import { default as default3 } from "@rollup/plugin-json"; import { nodeResolve } from "@rollup/plugin-node-resolve"; var RollupVueJsx = ViteVueJsx; var RollupRemoveVueFilePathPlugin = () => { const REGEX = [ /\[["']__file["'],\s*["'](.*?)["']\]/g, /__component__\.options\.__file.*/ ]; return { name: "remove-vue-filepath", transform(code) { const transformed = code.replaceAll(REGEX[0], "__FILE__").replace(REGEX[1], "__FILE__"); if (code !== transformed) return transformed; } }; }; async function rollupBuild(file, plugins) { const { snapshot } = await _rollupBuild(file, plugins, { external: ["vue", "@vueuse/core", /^\0.*/, /^\/vue-macros\/.*/], plugins: [ RollupEscapeNullCharacterPlugin(), RollupRemoveVueFilePathPlugin() ] }); return snapshot; } export { RollupEscapeNullCharacterPlugin2 as RollupEscapeNullCharacterPlugin, default3 as RollupJson, nodeResolve as RollupNodeResolve, RollupRemoveVueFilePathPlugin, RollupToStringPlugin, default2 as RollupVue, RollupVueJsx, Oxc as UnpluginOxc, removeSpaces, rollupBuild, testFixtures, testFixturesSkip };