Skip to content

Commit

Permalink
add nuxt image for lazyloading images
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerby Keith Aquino committed Feb 3, 2023
1 parent df61924 commit df3037d
Show file tree
Hide file tree
Showing 4 changed files with 300 additions and 22 deletions.
7 changes: 5 additions & 2 deletions components/Navbar/UserLoggedIn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
class="grid w-12 h-12 overflow-hidden border rounded-full aspect-square place-items-center"
>
<span class="sr-only">Profile</span>
<img
src="https://res.cloudinary.com/kuroji-fusky-s3/image/upload/q_75/projects/misc/ozzy-fp-banner.png"
<nuxt-img
provider="cloudinary"
src="/projects/misc/ozzy-fp-banner.png"
alt="Profile"
width="50"
height="50"
/>
</button>
</div>
Expand Down
29 changes: 20 additions & 9 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
"@nuxtjs/color-mode",
[
"@pinia/nuxt",
{
autoImports: ["defineStore", ["defineStore", "definePiniaStore"]],
},
],
],
app: {
head: {
link: [
{
href: ",/favicon.ico",
},
{
rel: "manifest",
href: "./manifest.json",
Expand All @@ -23,6 +17,17 @@ export default defineNuxtConfig({
],
},
},
// @ts-ignore
modules: [
"@nuxt/image-edge",
"@nuxtjs/color-mode",
[
"@pinia/nuxt",
{
autoImports: ["defineStore", ["defineStore", "definePiniaStore"]],
},
],
],
build: {
transpile: ["gsap"],
},
Expand All @@ -40,4 +45,10 @@ export default defineNuxtConfig({
shim: false,
strict: true,
},
// @nuxt/image-edge config
image: {
cloudinary: {
baseURL: "https://res.cloudinary.com/kuroji-fusky-s3/image/upload/",
},
},
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@fontsource/inter": "^4.5.14",
"@fontsource/open-sans": "^4.5.14",
"@iconify-prerendered/vue-fa6-brands": "^0.18.1662097805",
"@nuxt/image-edge": "^1.0.0-27919678.2f5b64b",
"@nuxtjs/color-mode": "^3.2.0",
"@pinia/nuxt": "^0.4.6",
"autoprefixer": "^10.4.13",
Expand All @@ -21,4 +22,4 @@
"sass": "^1.57.1",
"tailwindcss": "^3.2.4"
}
}
}
Loading

0 comments on commit df3037d

Please sign in to comment.