Automatically build declaration files when using assetpack
After use, the [/\ .] in the alias of the resources in the manifest will be automatically replaced with the underscore "_" for the IDE to provide prompt functionality
import {buildDeclaration} from "assetpack-plugin-declaration"
...
export default {
...
pipes: [
...
pixiManifest({
output: './src/manifest.json',
}),
buildDeclaration() // Add to the end
]
};
...
import {assets, loadBundle} from "./assets"; // The assets file is generated by this plugin.
...
await loadBundle('loading');
const pic = Sprite.from(assets.loading_pic);
app.stage.addChild(pic);
{
dist?:string, // declaration file save path, default: "./src/assets.ts"
objectName?: string, // assets object name, default: "assets"
createLoadFunction?: { // create loadBundle method, default: true
/**
* Whether to automatically inject into PIXI.Assets, default: false
* If true, it directly uses the built-in Assets.loadBundle() of PIXI.
*/
changePixiAssets?: boolean
}
}