• Version 1.12.8
  • Published
  • 8.92 kB
  • 1 dependency
  • MIT license


npm i @types/parcel-bundler
yarn add @types/parcel-bundler
pnpm add @types/parcel-bundler


TypeScript definitions for parcel-bundler



class ParcelBundler

class ParcelBundler {}


    entryFiles?: string | string[],
    options?: ParcelBundler.ParcelOptions

      method addAssetType

      addAssetType: (extension: string, path: string) => void;

        method addPackager

        addPackager: (type: string, packager: string) => void;

          method bundle

          bundle: () => Promise<ParcelBundler.ParcelBundle>;

            method middleware

            middleware: () => (
            req: express.Request,
            res: express.Response,
            next: express.NextFunction
            ) => any;

              method off

              off: (
              name: 'buildEnd' | 'bundled' | 'buildStart' | 'buildError',
              cb: (...any: any[]) => void
              ) => void;

                method on

                on: {
                (name: 'buildEnd', cb: () => void): void;
                (name: 'bundled', cb: (bundle: ParcelBundler.ParcelBundle) => void): void;
                (name: 'buildStart', cb: (entryPoints: string[]) => void): void;
                (name: 'buildError', cb: (error: Error) => void): void;

                  method serve

                  serve: (
                  port?: number,
                  https?: true | false | ParcelBundler.HttpsOptions,
                  host?: string
                  ) => Promise<any>;


                    interface HttpsOptions

                    interface HttpsOptions {}

                      property cert

                      cert?: string | undefined;
                      • Path to custom certificate


                      property key

                      key?: string | undefined;
                      • Path to custom key


                      interface ParcelBundle

                      interface ParcelBundle {}

                        property assets

                        assets: Set<any>;
                        • A Set of all assets inside the bundle

                        property childBundles

                        childBundles: Set<any>;
                        • A Set of all child bundles

                        property entryAsset

                        entryAsset: any;
                        • The entryPoint of the bundle, used for generating the name and gathering assets.

                        property name

                        name: string;
                        • The name of the bundle (generated using Asset.generateBundleName() of entryAsset)

                        property offsets

                        offsets: Map<ParcelAsset, number>;
                        • A Map<Asset, number(line number inside the bundle)> of all the locations of the assets inside the bundle, used to generate accurate source maps

                        property parentBundle

                        parentBundle?: any;
                        • The parent bundle, is null in case of the entry bundleany

                        property siblingBundles

                        siblingBundles: Set<any>;
                        • A Set of all sibling bundles

                        property siblingBundlesMap

                        siblingBundlesMap: Map<string, ParcelBundle>;
                        • A Map<String(Type: js, css, map, ...), Bundle> of all sibling bundles

                        property type

                        type: string;
                        • The type of assets it contains (e.g. js, css, map, ...)

                        interface ParcelOptions

                        interface ParcelOptions {}

                          property autoInstall

                          autoInstall?: boolean | undefined;
                          • Enable or disable auto install of missing dependencies found during bundling


                          property bundleNodeModules

                          bundleNodeModules?: true | false | undefined;
                          • By default, package.json dependencies are not included when using 'node' or 'electron' with the 'target' option.

                            Set to true to add them to the bundle.


                          property cache

                          cache?: boolean | undefined;
                          • Enabled or disables caching


                          property cacheDir

                          cacheDir?: string | undefined;
                          • The directory cache gets put in


                          property contentHash

                          contentHash?: boolean | undefined;
                          • Disable content hash from being included on the filename


                          property detailedReport

                          detailedReport?: boolean | undefined;
                          • Prints a detailed report of the bundles, assets, filesizes and times

                            Reports are only printed if watch is disabled


                          property global

                          global?: string | undefined;
                          • Expose modules as UMD under this name, disabled by default

                          property hmr

                          hmr?: true | false | undefined;
                          • Enable or disable HMR while watching


                          property hmrHostname

                          hmrHostname?: string | undefined;
                          • A hostname for hot module reload


                          property hmrPort

                          hmrPort?: 0 | number | undefined;
                          • The port the HMR socket runs on

                            Defaults to a random free port (0 in node.js resolves to a random free port)


                          property https

                          https?: true | false | HttpsOptions | undefined;
                          • Define a custom {key, cert} pair

                            Use true to generate one or false to use http

                          property logLevel

                          logLevel?: 3 | 2 | 1 | undefined;
                          • 3 = log everything, 2 = log warnings & errors, 1 = log errors


                          property minify

                          minify?: boolean | undefined;
                          • Minify files

                            process.env.NODE_ENV === 'production'

                          property outDir

                          outDir?: string | undefined;
                          • The out directory to put the build files in


                          property outFile

                          outFile?: string | undefined;
                          • The name of the outputFile


                          property publicUrl

                          publicUrl?: string | undefined;
                          • The url to server on


                          property scopeHoist

                          scopeHoist?: boolean | undefined;
                          • Turn on experimental scope hoisting/tree shaking flag, for smaller production bundles


                          property sourceMaps

                          sourceMaps?: boolean | undefined;
                          • Enable or disable sourcemaps

                            Defaults to enabled (not supported in minified builds yet)


                          property target

                          target?: 'browser' | 'node' | 'electron' | undefined;
                          • "browser"

                          property watch

                          watch?: boolean | undefined;
                          • Whether to watch the files and rebuild them on change

                            process.env.NODE_ENV !== 'production'

                          Type Aliases

                          type ParcelAsset

                          type ParcelAsset = any;

                            Package Files (1)

                            Dependencies (1)

                            Dev Dependencies (0)

                            No dev dependencies.

                            Peer Dependencies (0)

                            No peer dependencies.


                            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/@types/parcel-bundler.

                            • Markdown
                            • HTML
                              <a href="https://www.jsdocs.io/package/@types/parcel-bundler"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>