unplugin-vue-image
v0.1.6-beta.1
Published
Register global imports on demand for Vite and Webpack
Downloads
6
Maintainers
Readme
unplugin-vue-image
Starter template for unplugin.
Template Usage
To use this template, clone it down using:
npx degit antfu/unplugin-vue-image my-unplugin
And do a global replace of unplugin-vue-image
with your plugin name.
Then you can start developing your unplugin 🔥
To test your plugin, run: pnpm run dev
To release a new version, run: pnpm run release
Install
npm i unplugin-vue-image
// vite.config.ts
import Image from 'unplugin-vue-image/vite'
export default defineConfig({
plugins: [
Image({ /* options */ }),
],
})
Example: playground/
// rollup.config.js
import Image from 'unplugin-vue-image/rollup'
export default {
plugins: [
Image({ /* options */ }),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-vue-image/webpack')({ /* options */ }),
],
}
// nuxt.config.js
export default {
buildModules: [
['unplugin-vue-image/nuxt', { /* options */ }],
],
}
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-vue-image/webpack')({ /* options */ }),
],
},
}