Skip to main content

Manifest

This plugin generates a manifest file so you can easily load your assets in the browser. The manifest file contains a list of all the assets in your project, including their paths and aliases.

The plugin also allows you to create bundles of assets by using tags in your folder structure. This is useful for grouping assets together, such as images for a specific scene or level.

We believe this plugin is a must-have for any PixiJS project, as it simplifies the process of loading assets and helps you manage your project more efficiently.

Example

Original

Input Image
Input Image
import { pixiManifest } from "@assetpack/core/manifest";

export default {
...
pipes: [
...
// These options are the default values, all options shown here are optional
// This should be the last pipe in the list
pixiManifest({
output: "manifest.json",
createShortcuts: false,
trimExtensions: false,
includeMetaData: true,
includeFileSizes: false
nameStyle: 'short'
})
],
};

API

OptionTypeDescription
outputstringThe path to the manifest file.
Defaults to the output folder defined in your config.
createShortcutsbooleanWhether to create the shortest possible alias for an asset.
Defaults to false.
trimExtensionsbooleanWhether to trim the extensions from the asset aliases.
Defaults to false.
includeMetaDatabooleanWhether to include the tags the asset has used in the manifest file.
Defaults to true.
includeFileSizesfalse/gzip/rawWhether to include the file sizes of each asset in the manifest file. If enabled a progressSize attribute will be added to each assets src. This can then be used by external tools for progress bars, or calculating the size of a given bundle etc.
Defaults to false.
nameStyleshort|relativeThe name style for the bundle names in the manifest file.
Defaults to short.
srcSortOptionsobject, (assetsSrc: PixiManifestEntry['src']) => PixiManifestEntry['src']If an object:
order: 'ascending' or 'descending' (default: 'descending')
collatorOptions: Intl.Collator options for natural or locale-aware sorting.

If a function:
a custom comparator for advanced sorting logic.

Defaults to { order: 'descending' }.

Tags

TagFolder/FileDescription
mfolderGenerates a bundle entry in the manifest file.
mIgnorebothIgnores the folder/file from the manifest file.

Usage with Spine plugin

When using the Spine plugins, you should use the spineAtlasManifestMod plugin to augment the manifest file with the spine atlas files. This ensures that the spine atlas files are included in the manifest.

import { pixiManifest } from "@assetpack/core/manifest";
import { spineAtlasManifestMod } from '@assetpack/core/spine'

export default {
...
pipes: [
...
pixiManifest(),
spineAtlasManifestMod(),
]
};

Usage with TexturePacker plugin

When using the TexturePacker plugin, you should use the texturePackerManifestMod plugin to augment the manifest file. This ensures that the correct file size is used for the texture atlas files.

import { texturePackerManifestMod } from '@assetpack/core/texture-packer'

export default {
...
pipes: [
...
pixiManifest({ includeFileSizes: 'gzip' }),
texturePackerManifestMod({ includeFileSizes: 'gzip' }),
]
};