Vue-awesome-swiper: vue build err (Dom7)

Created on 4 Dec 2017  ·  5Comments  ·  Source: surmon-china/vue-awesome-swiper

when i user vue-awesome-swiper in vue , build err ;
ERROR in static/js/vendor.....Unexpected token:name [static/js/vende.....]

Swiper bug

Most helpful comment

sorry,I check out my webpack file and add this code solved my problem
alias: {
'swiper$': 'swiper/dist/js/swiper.js'
}

All 5 comments

same question here
image
version:
"vue": "^2.5.2",
"vue-awesome-swiper": "^3.0.4",

sorry,I check out my webpack file and add this code solved my problem
alias: {
'swiper$': 'swiper/dist/js/swiper.js'
}

Webpack - webpack.config.js:

alias: {
  'swiper$': 'swiper/dist/js/swiper.js'
}

Nuxt.js - nuxt.config.js

build: {
  extend(webpackConfig) {
     webpackConfig.resolve.alias['swiper$'] = 'swiper/dist/js/swiper.js'
     webpackConfig.resolve.alias['dom7$'] = 'dom7/dist/dom7.js'
  }
}

If you are encountering errors while packing with webpack, please refer to the solution here #206 #204. Add the corresponding alias code in your webpack config.

alias: {
  'swiper$': 'swiper/dist/js/swiper.js'
}

v3.0.6 fix it.

For anyone coming from google in 2020:
The solution above has moved to "'swiper/js", you can use

alias: {
  'swiper$': 'swiper/js/swiper.min.js'
}

Im using

"swiper": "^5.4.0",
"vue-awesome-swiper": "^4.1.1"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tilight picture tilight  ·  5Comments

LJade picture LJade  ·  6Comments

wuxiaobin1995 picture wuxiaobin1995  ·  4Comments

kooshkestani picture kooshkestani  ·  5Comments

pfasang picture pfasang  ·  5Comments