vite-plugin-spine-dynamic-url
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

vite-spine-dynamic-url

This plugin automatically replaces the URL of images in the atlas file with the dynamic url of the image generated by Vite.

Why

When using Spine in Vite, the URL of the image in the atlas file is not replaced with a dynamic URL, which will cause the image to fail to load.

Install

npm i vite-spine-dynamic-url --save-dev

Usage

Configure the plugin in vite.config.js:

// vite.config.js

import spineDynamicUrl from 'vite-spine-dynamic-url'

export default {
    plugins: [
        atlasDynamicUrl({ atlasInclude: "src/spines/**/*.atlas" }),
    ]
}

When loading a Spine data you should import it using the import or URL syntax so Vite can handle the .json name hashing.

More info about that can be found here.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Package Sidebar

Install

npm i vite-plugin-spine-dynamic-url

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

5.81 kB

Total Files

5

Last publish

Collaborators

  • wetrustinprize