vite-plugin-icons-spritesheet

Vite plugin that listens to an icon folder and outputs a spritesheet with optional types to specified location

MIT License

Downloads
8.1K
Stars
95
Committers
5

Bot releases are hidden (Show)

vite-plugin-icons-spritesheet - v2.2.1

Published by AlemTuzlak about 2 months ago

Fix for assetInlineLimit

Fixed an issue where the spritesheet wasn't picked up in certain conditions

What's Changed

New Contributors

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/v2.2.0...v2.2.1

vite-plugin-icons-spritesheet - v2.2.0 - Asset Inline Limit support Latest Release

Published by AlemTuzlak about 2 months ago

Vite assetInlineLimit respect

From v2.2.0 The plugin will respect your assetsInlineLimit defined in your Vite config and will only ignore it for the spritesheets generated by the plugin itself, meaning you don't have to opt-out of the inlining of small assets just to use this plugin

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/v2.1.0...v2.2.0

vite-plugin-icons-spritesheet - v2.1.0 - Multiple configs + formatters

Published by AlemTuzlak 2 months ago

Multiple configs are here!

From 2.1.0 you can pass in an array of configs instead of a single one which will generate multiple watchers and bundles accordingly. Check out the README for details on this!

Full example:

 iconsSpritesheet([
      {
        withTypes: true,
        inputDir: "icons",
        outputDir: "./app/icons",
        formatter: "prettier"
      },
      {
        withTypes: true,
        inputDir: "icons",
        outputDir: "./public/icons",
        formatter: "biome",
        pathToFormatterConfig: "./biome.json",
      }
    ]),

Formatting the outputs!

From 2.1.0 you can specify prettier or biome as formatters which will format your output files before they are generated and then write them to the directories. You can also specify a path to your formatter config to be used by the formatter under the hood via pathToFormatterConfig

Full example:

iconsSpritesheet({
  withTypes: true,
  inputDir: "icons",
  outputDir: "./public/icons",
  // Linter and path to config specified
  formatter: "biome",
  pathToFormatterConfig: "./biome.json",
}),

What's Changed

New Contributors

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/v2.0.0...v2.1.0

vite-plugin-icons-spritesheet - v2.0.0 - Runs on build

Published by AlemTuzlak 3 months ago

Runs on build

The plugin will now run BEFORE your build starts so the icon artifact is output to the location before the building starts.

Changed the types output

Now uses the generated array to generate the type instead of duplicating both for a smaller file

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/v1.3.0...v2.0.0

vite-plugin-icons-spritesheet - v1.3.0

Published by AlemTuzlak 4 months ago

Better Vite versioning support

The plugin uses Vite internal helpers to resolve the path but this was causing issues in vite.config.ts where the types were locked to a specific Vite version. The typesafety has been moved inside of the plugin now and the return type ahs been loosened.

Also, Vite is now a peerDependendency instead of a dependency so it can work with a bigger range of Vite versions.

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/v1.2.1...v1.3.0

vite-plugin-icons-spritesheet - v1.2.1

Published by AlemTuzlak 5 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/v1.2.0...v1.2.1

vite-plugin-icons-spritesheet - v1.2.0

Published by AlemTuzlak 5 months ago

Icon naming conventions

From v1.2.0 onwards you can change and customize your icon naming convention to suite your needs.

What's Changed

New Contributors

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/v1.1.2...v1.2.0

vite-plugin-icons-spritesheet - v1.1.2

Published by AlemTuzlak 5 months ago

Runs on initial vite dev server start

Now the icons will be generated as soon as you start your server.

What's Changed

New Contributors

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/v1.1.1...v1.1.2

vite-plugin-icons-spritesheet - v1.1.1

Published by AlemTuzlak 5 months ago

Fixed an issue where if there were no files in the output dir the plugin didn't work properly

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/1.1.0...v1.1.1

vite-plugin-icons-spritesheet - 1.1.0

Published by AlemTuzlak 5 months ago

Improvements to writes

Now only writes if there are any changes, does not write on every change.

Listener improvements

Listens to add/delete events as well and outputs the icons when a new one is added or old one is removed.

Full Changelog: https://github.com/forge42dev/vite-plugin-icons-spritesheet/compare/1.0.0...1.1.0

vite-plugin-icons-spritesheet - 1.0.0

Published by AlemTuzlak 6 months ago