@tarojs/cli

  • Version 4.3.0
  • Published
  • 468 kB
  • 16 dependencies
  • MIT license

Install

npm i @tarojs/cli
yarn add @tarojs/cli
pnpm add @tarojs/cli

Overview

cli tool for taro

Index

Variables

variable _default

const _default: {
doctor: { validators: ((args: any) => any)[] };
Project: typeof Project;
Creator: typeof Creator;
defineConfig: typeof defineConfig;
getRootPath: typeof getRootPath;
};

    variable doctor

    const doctor: { validators: ((args: any) => any)[] };

      Functions

      function defineConfig

      defineConfig: <T extends CompilerTypes = CompilerWebpackTypes>(
      config: UserConfigExport<T>
      ) => UserConfigExport<T>;
      • v3.6.9 暂不支持 react native

      function getRootPath

      getRootPath: () => string;

        Classes

        class Creator

        class Creator {}

          constructor

          constructor(sourceRoot?: string);

            property rootPath

            rootPath: string;

              method init

              init: () => void;

                method sourceRoot

                sourceRoot: (rootPath?: string) => string;

                  method templatePath

                  templatePath: (...args: string[]) => string;

                    method write

                    write: () => void;

                      class Project

                      class Project extends Creator {}

                        constructor

                        constructor(options: IProjectConfOptions);

                          property askBuildEs5

                          askBuildEs5: AskMethods;

                            property askCompiler

                            askCompiler: AskMethods;

                              property askCSS

                              askCSS: AskMethods;

                                property askDescription

                                askDescription: AskMethods;

                                  property askFramework

                                  askFramework: AskMethods;

                                    property askNpm

                                    askNpm: AskMethods;

                                      property askPlatforms

                                      askPlatforms: AskMethods;

                                        property askProjectName

                                        askProjectName: AskMethods;

                                          property askTemplate

                                          askTemplate: AskMethods;

                                            property askTemplateSource

                                            askTemplateSource: AskMethods;

                                              property askTypescript

                                              askTypescript: AskMethods;

                                                property conf

                                                conf: IProjectConfOptions;

                                                  property rootPath

                                                  rootPath: string;

                                                    method ask

                                                    ask: () => Promise<{
                                                    projectName: string;
                                                    projectDir: string;
                                                    npm: NpmType;
                                                    templateSource: string;
                                                    clone?: boolean | undefined;
                                                    template: string;
                                                    description?: string | undefined;
                                                    typescript?: boolean | undefined;
                                                    buildEs5?: boolean | undefined;
                                                    css: CSSType;
                                                    date?: string | undefined;
                                                    src?: string | undefined;
                                                    sourceRoot?: string | undefined;
                                                    env?: string | undefined;
                                                    autoInstall?: boolean | undefined;
                                                    hideDefaultTemplate?: boolean | undefined;
                                                    framework: FrameworkType;
                                                    compiler?: CompilerType | undefined;
                                                    platforms?: string[] | undefined;
                                                    ask?: (config: object) => void | Promise<void>;
                                                    initInCurrentDir?: boolean | undefined;
                                                    }>;

                                                      method create

                                                      create: () => Promise<void>;

                                                        method fetchTemplates

                                                        fetchTemplates: (answers: IProjectConf) => Promise<ITemplates[]>;

                                                          method init

                                                          init: () => void;

                                                            method write

                                                            write: (cb?: () => void) => void;

                                                              Interfaces

                                                              interface ConfigEnv

                                                              interface ConfigEnv {}

                                                                property command

                                                                command: string;
                                                                • taro 当前执行的命令

                                                                property mode

                                                                mode: string;
                                                                • 当前模式 (mode)

                                                                Type Aliases

                                                                type UserConfigExport

                                                                type UserConfigExport<T extends CompilerTypes = CompilerWebpackTypes> =
                                                                | IProjectConfig<T>
                                                                | Promise<IProjectConfig<T>>
                                                                | UserConfigFn;

                                                                  type UserConfigFn

                                                                  type UserConfigFn<T extends CompilerTypes = CompilerWebpackTypes> = (
                                                                  merge: WebpackMerge,
                                                                  env: ConfigEnv
                                                                  ) => IProjectConfig<T> | Promise<IProjectConfig<T>>;

                                                                    Namespaces

                                                                    namespace @tarojs/components

                                                                    module '@tarojs/components' {}

                                                                      namespace *.css

                                                                      module '*.css' {}

                                                                        namespace *.gif

                                                                        module '*.gif' {}

                                                                          namespace *.jpeg

                                                                          module '*.jpeg' {}

                                                                            namespace *.jpg

                                                                            module '*.jpg' {}

                                                                              namespace *.json

                                                                              module '*.json' {}

                                                                                variable value

                                                                                const value: any;

                                                                                  namespace *.less

                                                                                  module '*.less' {}

                                                                                    namespace *.png

                                                                                    module '*.png' {}

                                                                                      namespace *.sass

                                                                                      module '*.sass' {}

                                                                                        namespace *.scss

                                                                                        module '*.scss' {}

                                                                                          namespace *.styl

                                                                                          module '*.styl' {}

                                                                                            namespace *.svg

                                                                                            module '*.svg' {}

                                                                                              Package Files (8)

                                                                                              Dependencies (16)

                                                                                              Dev Dependencies (9)

                                                                                              Peer Dependencies (0)

                                                                                              No peer dependencies.

                                                                                              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/@tarojs/cli.

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