• Parameters

    • params: {
          autoSideEffectsFalse?: boolean;
          bundledWorkspaceDeps?: MaybeArray<string | RegExp>;
          chunkFileName?: string;
          copyPackageFiles?: string[];
          copyRootFiles?: string[];
          finalize?: (ctx: BuildHookContext) => MaybePromise<void>;
          finalizePackageJson?: (ctx: BuildHookContext) => MaybePromise<void>;
          insertTypesEntry?: boolean;
          packageRoot?: string;
          preparePackageJson?: (ctx: BuildHookContext) => void;
          root: string | URL;
          rootFieldsToCopy?: string[];
          typesEntryRoot?: string;
      }
      • OptionalautoSideEffectsFalse?: boolean

        when true, will automatically add sideEffects: false to generated package.json-s

      • OptionalbundledWorkspaceDeps?: MaybeArray<string | RegExp>

        workspace dependencies that are bundled with the library, and as such shouldn't present in the final package.json

      • OptionalchunkFileName?: string

        the modifiable part of the chunk file name there will be a prefix of chunks/[format]/ and a suffix of .js

        [hash]

      • OptionalcopyPackageFiles?: string[]

        files to copy from the package root directory to the build directory

        ['README.md']
        
      • OptionalcopyRootFiles?: string[]

        files to copy from the workspace root directory to the build directory

        ['LICENSE']
        
      • Optionalfinalize?: (ctx: BuildHookContext) => MaybePromise<void>

        hook to run after the build is done, time to do any final modifications to the package contents (note: this hook is run before package-level hooks)

      • OptionalfinalizePackageJson?: (ctx: BuildHookContext) => MaybePromise<void>

        hook to run after the package.json file is finalized, right before it is written to disk you can modify the .packageJson property of the context (note: this hook is run before package-level hooks)

      • OptionalinsertTypesEntry?: boolean

        when using with vite-plugin-dts, use this flag instead of their insertTypesEntry option to insert the types entry, as their implementation doesn't always yield the correct result

        false
        
      • OptionalpackageRoot?: string

        package root, will be passed to vite's root option

        process.cwd()

      • OptionalpreparePackageJson?: (ctx: BuildHookContext) => void

        hook to run before anything is done to the package.json file you can modify the .packageJson property of the context

        this hook is called before vite build has started, and as such .outDir is not available yet (note: this hook is run before package-level hooks)

      • root: string | URL
      • OptionalrootFieldsToCopy?: string[]
      • OptionaltypesEntryRoot?: string

        when using with vite-plugin-dts, this value should match entryRoot value passed to the vite-plugin-dts plugin

    Returns Promise<PluginOption[]>