unplugin-data-uri
v0.2.1
Published
A universal bundler plugin which imports modules from Data URIs.
Downloads
2
Maintainers
Readme
unplugin-data-uri
🍣 A universal bundler plugin which imports modules from Data URIs.
Install
npm i unplugin-data-uri
// vite.config.ts
import unpluginDataUri from 'unplugin-data-uri/vite'
export default defineConfig({
plugins: [
unpluginDataUri({
/* options */
}),
],
})
Example: playground/
// rollup.config.js
import unpluginDataUri from 'unplugin-data-uri/rollup'
export default {
plugins: [
unpluginDataUri({
/* options */
}),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-data-uri/webpack')({
/* options */
}),
],
}
// nuxt.config.js
export default defineNuxtConfig({
modules: [
[
'unplugin-data-uri/nuxt',
{
/* options */
},
],
],
})
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-data-uri/webpack')({
/* options */
}),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import unpluginDataUri from 'unplugin-data-uri/esbuild'
build({
plugins: [unpluginDataUri()],
})
Usage
Options
For all options please refer to docs.
This plugin accepts all @rollup/plugin-data-uri options.