Packager
A plugin type: Turn a group of assets into a bundle file
Packagers determine how to merge different asset types into a single bundle.
import { Packager } from "@parcel/plugin";
export default new Packager({
  async package({ bundle }) {
    // ...
    return { contents, map };
  },
});
ยถ Relevant API
SymbolResolution parcel/packages/core/types/index.js:868
Specifies a symbol in an asset
type SymbolResolutionย = {|
  +asset: Asset,
The Asset which exports the symbol.
  +exportSymbol: Symbol | string,
under which name the symbol is exported
  +symbol: void | null | false | Symbol,
The identifier under which the symbol can be referenced.
  +loc: ?SourceLocation,
The location of the specifier that lead to this result.
|}
Referenced by:
BundleGraph, ExportSymbolResolutionExportSymbolResolution parcel/packages/core/types/index.js:882
type ExportSymbolResolutionย = {|
  ...SymbolResolution,
  +exportAs: Symbol | string,
|}
Referenced by:
BundleGraphPackager parcel/packages/core/types/index.js:1149
type Packagerย = {|
  loadConfig?: ({|
    bundle: NamedBundle,
    options: PluginOptions,
    logger: PluginLogger,
  |}) => Async<?ConfigOutput>,
  package({|
    bundle: NamedBundle,
    bundleGraph: BundleGraph<NamedBundle>,
    options: PluginOptions,
    logger: PluginLogger,
    config: ?ConfigResult,
    getInlineBundleContents: (Bundle, BundleGraph<NamedBundle>) => Async<{|
      contents: Blob
    |}>,
    getSourceMapReference: (map: ?SourceMap) => Async<?string>,
  |}): Async<BundleResult>,
|}