vite-plugin-uhuu
v1.1.0
Published
Vite plugin to zip template package after build.
Readme
vite-plugin-uhuu
Uhuu.io template builder plugin for vite. Zips the build output into uhuu.zip
so the template can be uploaded to the Uhuu platform.
Edit vite.config.js
import uhuu from 'vite-plugin-uhuu'
// include in plugins
{
plugins:[uhuu()]
}Excluding files from the package
Vite copies everything in public/ into the build output verbatim, including
dot-directories. Build and QA tooling often writes artifacts there, and those
would otherwise be zipped into the template package -- in one real case ~53MB of
screenshot diffs shipped alongside a 340KB template.
Since 1.1.0, entries whose name starts with . are excluded by default, and
excluded paths are logged during the build.
Override with exclude, which accepts strings (matched against the entry name or
its path relative to the output directory), regular expressions, or predicates:
uhuu({
exclude: [/^\./, 'stats.html', (name, relativePath) => relativePath.endsWith('.map')]
})Pass exclude: [] to restore the pre-1.1.0 behaviour of zipping everything.
fileName renames the archive (default uhuu.zip).
Changelog
1.1.0
- Exclude dot-entries from the package by default; add the
excludeandfileNameoptions. - Resolve
build.outDiragainst the Vite root instead of the plugin's own location innode_modules, so a project withoutenvDirset no longer looks for its output insidenode_modules/vite-plugin-uhuu/. closeBundlenow awaits the archive write, so the build cannot finish beforeuhuu.zipexists.
