@best-shot/preset-asset
v0.12.2
Published
A `best-shot` preset for asset
Downloads
333
Maintainers
Readme
@best-shot/preset-asset
A best-shot
preset for asset.
This preset offer the following features:
- bundle
jpg
/jpeg
/png
/gif
/svg
- bundle
woff
/woff2
/otf
/eot
/ttf
- image minify in production mode
Installation
npm install @best-shot/preset-asset --save-dev
Usage
// example: .best-shot/config.mjs
export const config = {
presets: ['asset']
};
Tips
The mutable
resourceQuery for image
Generate mutable resources filename:
import('./avatar/male.png?mutable');
// image/avatar/male.png
import('./header/header-bg.png');
// image/header-bg.min.xxxxxxxx.png
Preprocess non-ascii character
天地人-abc.jpg -> 4273f2f7-abc.jpg