This project uses a Rollup plugin to pack images using the free-tex-packer-core library. It is written in TypeScript.
To install this package, run the following command:
npm
npx jsr add @snrn/rollup-plugin-texture-packer
yarn
yarn dlx jsr add @snrn/rollup-plugin-texture-packer
import texturePacker, {PackerExporterType} from '@snrn/rollup-plugin-texture-packer';
export default {
plugins: [
texturePacker({
inputDir: 'path/to/input',
outputDir: 'path/to/output',
options: {
textureName: "css",
prependFolderName: false,
exporter: PackerExporterType.CSS,
}
})
]
};
-
input
- The input directory where the images are located. -
output
- The output directory where the atlas and the images will be saved. -
options
- Options or an array of options. Uses free-tex-packer-core options. See here. Multiple options can be passed to generate multiple atlases.