Skip to content

Commit

Permalink
chore: update swiper to v10
Browse files Browse the repository at this point in the history
  • Loading branch information
TakNePoidet committed Jul 15, 2023
1 parent e8cfed9 commit f8308be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@nuxt/kit": "^3.6.3",
"swiper": "^9.4.1"
"swiper": "^10.0.4"
},
"devDependencies": {
"@nuxt/module-builder": "^0.4.0",
Expand Down
14 changes: 4 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as swiper from 'swiper'
import * as swiperModulesImports from 'swiper/modules'
import {
defineNuxtModule,
addImports,
Expand Down Expand Up @@ -47,7 +47,7 @@ export default defineNuxtModule<SwiperModuleOptions>({
]

// Import Each Swiper Module & CSS if it exists.
for (const [key, _] of Object.entries(swiper)) {
for (const [key, _] of Object.entries(swiperModulesImports)) {
// Turn key to snake-case.
const snakeCase: string = key
.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2')
Expand Down Expand Up @@ -82,7 +82,7 @@ export default defineNuxtModule<SwiperModuleOptions>({
moduleImports.push({
name: key,
as: `${prefix}${key}`,
from: 'swiper'
from: 'swiper/modules'
})
}
}
Expand Down

0 comments on commit f8308be

Please sign in to comment.