Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Improve configuration options for Pixi Manifest generation #33

Open
luke-thompson-vgw opened this issue Mar 31, 2023 · 2 comments

Comments

@luke-thompson-vgw
Copy link

Thanks for the great work on assetpack, I've been experimenting to see if I can integrate it into a project and an into a couple of issues related to creating a Pixi manifest.

The first issue is with customising output directory.

The manifest plugin generates file paths for the manifests "srcs" property, but I can't see a way to prepend to that file path.

I'm using Vite and directing assetpack to output to the 'public' directory deletes everything in that folder so I can't host any public assets not handled by assetpack.

I think it would be useful to be able to prepend to the file path that is created by the manifest plugin so the files handled by assetpack can all be placed in a sub directory and the "srcs" property in the Pixi manifest still be correct.

The second issue is with handling Spine files.

I would like to have the Spine json files added to the generated Pixi manifest, but not the atlas files. It currently adds the Spine json, atlas and png files all to the manifest then Pixi fails when it tries to load the atlas file as an image.

What I think would work is if we could add an ignore property to the manifest plugin options so that we can specify which files should not be added to the manifest. Whilst still allowing assetpack to move the files to the output directory.

@Zyie
Copy link
Member

Zyie commented Apr 13, 2023

Hey @luke-thompson-vgw thanks for the feedback!

I'm not entirely sure what you mean with your first issue. Could you give me a current/expected result for the manifest?

As for the spine issue, yes i think adding the ability to ignore certain files in the manifest is a good idea. I'll add that to the list.

@luke-thompson-vgw
Copy link
Author

Thanks for asking for more information. Whilst checking my work in order to explain the issue better I have found the solution is actually already in the Pixi Assets class.

The below code solves my problem.

Assets.init({ basePath: "folder-name/", manifest: assetManifest });

I was trying to add a folder to the base path of where Pixi should load the assets in the asset manifest from, but it can be done by passing an option in to the Assets.init method already. So you can disregard that first issue.

As for the second issue. I'd be happy to try make the change to add an ignore list and submit a PR when I get a chance to do the work. Would that be welcome?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants