1.0.4 • Published 3 years ago
@bicou/nuxt-image-directus v1.0.4
Directus provider for NuxtImage
Provides Directus assets source for Nuxt Image.
Quick Setup
- Add
@bicou/nuxt-image-directusdependency to your project
# Using pnpm
pnpm add -D @bicou/nuxt-image-directus
# Using yarn
yarn add --dev @bicou/nuxt-image-directus
# Using npm
npm install --save-dev @bicou/nuxt-image-directus- Add
@bicou/nuxt-image-directusto themodulessection ofnuxt.config.tsbefore@nuxt/image-edge
export default defineNuxtConfig({
modules: [
// must be listed before @nuxt/image-edge
"@bicou/nuxt-image-directus",
"@nuxt/image-edge"
]
})- Add the alias
#image-directusto the list of providers for nuxt image and passbaseURLoption :
export default defineNuxtConfig({
modules: [
"@bicou/nuxt-image-directus",
"@nuxt/image-edge"
],
image: {
providers: {
directus: {
// need to use runtime alias
provider: "#image-directus",
options: {
// path to your directus assets
baseURL: "https://directushost:8055/assets"
}
}
}
}
})That's it! You can now use <nuxt-img provider="directus" src="..." /> or <nuxt-picture provider="directus" src="..." /> with your Directus assets in your Nuxt app ✨
Development
# Install dependencies
pnpm install
# Generate type stubs
pnpm run prepare
# Develop with the playground
pnpm run dev
# Build the playground
pnpm run build
# Run ESLint
pnpm run lint