@vitejs/plugin-vue

  • Version 4.5.2
  • Published
  • 184 kB
  • No dependencies
  • MIT license

Install

npm i @vitejs/plugin-vue
yarn add @vitejs/plugin-vue
pnpm add @vitejs/plugin-vue

Overview

> Note: as of `vue` 3.2.13+ and `@vitejs/plugin-vue` 1.9.0+, `@vue/compiler-sfc` is no longer required as a peer dependency.

Index

Functions

function parseVueRequest

parseVueRequest: (id: string) => { filename: string; query: VueQuery };

    function vuePlugin

    vuePlugin: (rawOptions?: Options) => Plugin;

      Interfaces

      interface Options

      interface Options {}

        property compiler

        compiler?: typeof _compiler;
        • Use custom compiler-sfc instance. Can be used to force a specific version.

        property customElement

        customElement?: boolean | string | RegExp | (string | RegExp)[];
        • Transform Vue SFCs into custom elements. - true: all *.vue imports are converted into custom elements - string | RegExp: matched files are converted into custom elements

          /.ce.vue$/

        property exclude

        exclude?: string | RegExp | (string | RegExp)[];

          property include

          include?: string | RegExp | (string | RegExp)[];

            property isProduction

            isProduction?: boolean;

              property reactivityTransform

              reactivityTransform?: boolean | string | RegExp | (string | RegExp)[];
              • Enable Vue reactivity transform (experimental). https://vuejs.org/guide/extras/reactivity-transform.html - true: transform will be enabled for all vue,js(x),ts(x) files except those inside node_modules - string | RegExp: apply to vue + only matched files (will include node_modules, so specify directories if necessary) - false: disable in all cases

                Deprecated

                the Reactivity Transform proposal has been dropped. This feature will be removed from Vue core in 3.4. If you intend to continue using it, disable this and switch to the [Vue Macros implementation](https://vue-macros.sxzz.moe/features/reactivity-transform.html).

                false

              property script

              script?: Partial<
              Pick<
              SFCScriptCompileOptions,
              | 'babelParserPlugins'
              | 'globalTypeFiles'
              | 'defineModel'
              | 'propsDestructure'
              | 'fs'
              | 'reactivityTransform'
              | 'hoistStatic'
              >
              >;

                property style

                style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>;

                  property template

                  template?: Partial<
                  Pick<
                  SFCTemplateCompileOptions,
                  | 'compiler'
                  | 'compilerOptions'
                  | 'preprocessOptions'
                  | 'preprocessCustomRequire'
                  | 'transformAssetUrls'
                  >
                  >;

                    interface ResolvedOptions

                    interface ResolvedOptions extends Options {}

                      property compiler

                      compiler: typeof _compiler;

                        property cssDevSourcemap

                        cssDevSourcemap: boolean;

                          property devServer

                          devServer?: ViteDevServer;

                            property devToolsEnabled

                            devToolsEnabled?: boolean;

                              property root

                              root: string;

                                property sourceMap

                                sourceMap: boolean;

                                  interface VueQuery

                                  interface VueQuery {}

                                    property id

                                    id?: string;

                                      property index

                                      index?: number;

                                        property lang

                                        lang?: string;

                                          property raw

                                          raw?: boolean;

                                            property scoped

                                            scoped?: boolean;

                                              property src

                                              src?: string;

                                                property type

                                                type?: 'script' | 'template' | 'style' | 'custom';

                                                  property url

                                                  url?: boolean;

                                                    property vue

                                                    vue?: boolean;

                                                      Package Files (1)

                                                      Dependencies (0)

                                                      No dependencies.

                                                      Dev Dependencies (8)

                                                      Peer Dependencies (2)

                                                      Badge

                                                      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@vitejs/plugin-vue.

                                                      • Markdown
                                                        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@vitejs/plugin-vue)
                                                      • HTML
                                                        <a href="https://www.jsdocs.io/package/@vitejs/plugin-vue"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>