@best-shot/preset-asset

0.12.2 • Public • Published

@best-shot/preset-asset logo

A best-shot preset for asset.

npm github node

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

Related

Package Sidebar

Install

npm i @best-shot/preset-asset

Weekly Downloads

68

Version

0.12.2

License

MIT

Unpacked Size

9.64 kB

Total Files

8

Last publish

Collaborators

  • airkro