rollup-plugin-assetize
v1.0.3
Published
A small rollup plugin for put assets in place.
Downloads
2
Readme
rollup-plugin-assetize
A small Rollup plugin for handling assets (markup, stylesheets, images, and fonts).
All assets can be imported from the code as usual. The plugin collects the imported assets and writes them to the configured output directory. For each asset also the referenced assets (e.g. linked stylesheets im HTML) are collected if they have a known extension and are referenced with a relative path.
Installation
npm install --save-dev rollup-plugin-assetize
Usage
// rollup.config.js
import assetize from "rollup-plugin-assetize";
export default {
input: "src/main.js",
plugins: [
assetize({
input: [], // addition assets which should be emitted
output: {
dir: "assets", // directory where the assets should be emitted
minify: false, // minify the assets?
paths: {}, // custom output path mappings (source path => target path)
},
web: {
root: "/assets", // root path of asset urls
paths: {}, // custom url path mappings (source path => target path)
},
}),
]
};