@vue/component-compiler

  • Version 4.2.4
  • Published
  • 50.3 kB
  • 9 dependencies
  • MIT license

Install

npm i @vue/component-compiler
yarn add @vue/component-compiler
pnpm add @vue/component-compiler

Overview

bundler agnostic API for compiling Vue SFC

Index

Functions

function assemble

assemble: (
compiler: SFCCompiler,
filename: string,
result: DescriptorCompileResult,
options?: AssembleOptions
) => AssembleResults;

    function assembleFromSource

    assembleFromSource: (
    compiler: SFCCompiler,
    options: AssembleOptions,
    { filename, script, template, styles, scopeId }: AssembleSource
    ) => AssembleResults;

      function createCompiler

      createCompiler: ({
      script,
      style,
      template,
      }: {
      script: ScriptOptions;
      style: StyleOptions;
      template: TemplateOptions;
      }) => SFCCompiler;

        function createDefaultCompiler

        createDefaultCompiler: (options?: {
        script?: ScriptOptions | undefined;
        style?: StyleOptions | undefined;
        template?: TemplateOptions | undefined;
        }) => SFCCompiler;

          Classes

          class SFCCompiler

          class SFCCompiler {}

            constructor

            constructor(
            script: ScriptOptions,
            style: StyleOptions,
            template: TemplateOptions,
            resolve?: RequireResolve
            );

              property resolve

              resolve: RequireResolve;

                property script

                script: ScriptOptions;

                  property style

                  style: StyleOptions;

                    property template

                    template: TemplateOptions;

                      method compileStyle

                      compileStyle: (
                      filename: string,
                      scopeId: string,
                      style: SFCBlock
                      ) => StyleCompileResult;

                        method compileStyleAsync

                        compileStyleAsync: (
                        filename: string,
                        scopeId: string,
                        style: SFCBlock
                        ) => Promise<StyleCompileResult>;

                          method compileTemplate

                          compileTemplate: (
                          filename: string,
                          template: SFCBlock
                          ) => TemplateCompileResult & { functional: boolean };

                            method compileToDescriptor

                            compileToDescriptor: (
                            filename: string,
                            source: string
                            ) => DescriptorCompileResult;

                              method compileToDescriptorAsync

                              compileToDescriptorAsync: (
                              filename: string,
                              source: string
                              ) => Promise<DescriptorCompileResult>;

                                Interfaces

                                interface AssembleOptions

                                interface AssembleOptions {}

                                  property isWebComponent

                                  isWebComponent?: boolean;

                                    property normalizer

                                    normalizer?: string;

                                      property styleInjector

                                      styleInjector?: string;

                                        property styleInjectorShadow

                                        styleInjectorShadow?: string;

                                          property styleInjectorSSR

                                          styleInjectorSSR?: string;

                                            interface AssembleResults

                                            interface AssembleResults {}

                                              property code

                                              code: string;

                                                property map

                                                map?: any;

                                                  interface AssembleSource

                                                  interface AssembleSource {}

                                                    property filename

                                                    filename: string;

                                                      property scopeId

                                                      scopeId: string;

                                                        property script

                                                        script?: {
                                                        source: string;
                                                        map?: any;
                                                        };

                                                          property styles

                                                          styles: Array<{
                                                          source: string;
                                                          scoped?: boolean;
                                                          media?: string;
                                                          map?: any;
                                                          moduleName?: string;
                                                          module?: any;
                                                          }>;

                                                            property template

                                                            template?: {
                                                            source: string;
                                                            functional?: boolean;
                                                            };

                                                              interface CompileResult

                                                              interface CompileResult {}

                                                                property code

                                                                code: string;

                                                                  property map

                                                                  map?: any;

                                                                    interface DescriptorCompileResult

                                                                    interface DescriptorCompileResult {}

                                                                      property customBlocks

                                                                      customBlocks: SFCBlock[];

                                                                        property scopeId

                                                                        scopeId: string;

                                                                          property script

                                                                          script?: CompileResult;

                                                                            property styles

                                                                            styles: StyleCompileResult[];

                                                                              property template

                                                                              template?: TemplateCompileResult & {
                                                                              functional: boolean;
                                                                              };

                                                                                interface ScriptOptions

                                                                                interface ScriptOptions {}

                                                                                  property preprocessorOptions

                                                                                  preprocessorOptions?: any;

                                                                                    interface StyleOptions

                                                                                    interface StyleOptions {}

                                                                                      property postcssCleanOptions

                                                                                      postcssCleanOptions?: any;

                                                                                        property postcssModulesOptions

                                                                                        postcssModulesOptions?: any;

                                                                                          property postcssOptions

                                                                                          postcssOptions?: any;

                                                                                            property postcssPlugins

                                                                                            postcssPlugins?: any[];

                                                                                              property preprocessOptions

                                                                                              preprocessOptions?: any;

                                                                                                property trim

                                                                                                trim?: boolean;

                                                                                                  interface TemplateOptions

                                                                                                  interface TemplateOptions {}

                                                                                                    property compiler

                                                                                                    compiler: VueTemplateCompiler;

                                                                                                      property compilerOptions

                                                                                                      compilerOptions: VueTemplateCompilerOptions;

                                                                                                        property isProduction

                                                                                                        isProduction?: boolean;

                                                                                                          property optimizeSSR

                                                                                                          optimizeSSR?: boolean;

                                                                                                            property preprocessOptions

                                                                                                            preprocessOptions?: any;

                                                                                                              property transformAssetUrls

                                                                                                              transformAssetUrls?: AssetURLOptions | boolean;

                                                                                                                property transpileOptions

                                                                                                                transpileOptions?: any;

                                                                                                                  Type Aliases

                                                                                                                  type StyleCompileResult

                                                                                                                  type StyleCompileResult = StyleCompileResults & {
                                                                                                                  scoped?: boolean;
                                                                                                                  media?: string;
                                                                                                                  moduleName?: string;
                                                                                                                  module?: any;
                                                                                                                  };

                                                                                                                    Package Files (3)

                                                                                                                    Dependencies (9)

                                                                                                                    Dev Dependencies (20)

                                                                                                                    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/@vue/component-compiler.

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