Modern.js Module will handle static assets used in the code. If configuration is required, then the buildConfig.asset
API can be used.
By default, Modern.js Module handles the following static assets:
'.svg'
、'.png'
、'.jpg'
、'.jpeg'
、'.gif'
、'.webp'
'.ttf'
、'.otf'
、'.woff'
、'.woff2'
、'.eot'
'.mp3'
、'.mp4'
、'.webm'
、'.ogg'
、'.wav'
、'.flac'
、'.aac'
、'.mov'
For the handling of static files, Modern.js Module currently supports the following functions.
. /assets
.Let us look at the following example:
bg.png
is less than 10 kb, then the output directory structure and file content are.bg.png
is larger than 10 kb, then the output directory structure and file content are.When wanting to modify the default behavior, the following API can be used:
asset.path
: modify the output path of the static assets.asset.limit
: modify the threshold value for inline assets.