Closed Chrissi2812 closed 2 years ago
Same problem
Hey @ClementGuerin,
you have to include it in the whiteListedModules
. So vue can compile it.
let whiteListedModules = ['vue', 'vue-lottie']
let rendererConfig = {
devtool: '#cheap-module-eval-source-map',
entry: {
renderer: path.join(__dirname, '../src/renderer/main.js')
},
externals: [
...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d))
],
Hope this helps.
As an alternative just copy the lottie.vue
file to your project an install npm install lottie-web
.
Thanks ! I've use lottie-web but I will try to reinstall vue-lottie for my next project with your fix.
Finally succeeded to make it work with :
import Lottie from 'vue-lottie/src/lottie.vue';
import animationData from './my-lottie-file.json';
...
data() {
return {
lottieOptions: {
animationData,
},
animationSpeed: 1
}
}
and
<lottie :options="lottieOptions" :height="400" :width="400" v-on:animCreated="handleAnimation"/>
Steps to Reproduce
What Happens
The template doesn't get compiled and this js error is shown
Expected Behaviour
the
lottie.vue
-file should be compiled or thedist/build.js
-File should be imported when it's used like this.But The Build.js doesn't work either with
import Lottie from 'vue-lottie'
ps. I use vue-electron
webpack.config.js