@open-xchange/vite-helper
v0.1.1
Published
A collection of implementation helpers for Vite plugins
Downloads
835
Maintainers
Keywords
Readme
@open-xchange/vite-helper
A collection of implementation helpers for Vite plugins.
This package provides multiple submodules.
@open-xchange/vite-helper/utils
Exports assorted types and utility functions needed for plugin implementations.
@open-xchange/vite-helper/file
Exports utility functions for files and file paths needed for plugin implementations.
@open-xchange/vite-helper/logger
Exports the class Logger
that encapsulates a Vite logger instance. Enforces consistent logging style for all Vite plugins.
@open-xchange/vite-helper/cache
Exports the class Cache
that is a simple value cache backed by a native Map<string, T>
with additional helper methods.
Main: @open-xchange/vite-helper
Exports the class PluginHelper
. Provides helper methods for:
- Logging (encapsulates a
Logger
instance, see above). - Type narrowing and type assertions of unknown values at runtime.
- Reading and writing binary files, text files, and JSON/YAML configuration files (validated by JSON schemas).
- Managing virtual module identifiers (also for multiple instances of the same plugin).
- Caching of expensive intermediate results based on config file timestamps.