Javascript 在Gridsome中加载lottie JSON文件

Javascript 在Gridsome中加载lottie JSON文件,javascript,vue.js,webpack,lottie,gridsome,Javascript,Vue.js,Webpack,Lottie,Gridsome,我尝试在Gridsome中使用,但未能成功导入存储在src/assets/animations/success.json中的动画文件。我得到一个404错误 在我的模板中,我像这样使用lottie: <template> </Layout> <lottie-animation path="./assets/animations/success.json" /> </Layout> </template> co

我尝试在Gridsome中使用,但未能成功导入存储在src/assets/animations/success.json中的动画文件。我得到一个404错误

在我的模板中,我像这样使用lottie:

<template>
 </Layout>
  <lottie-animation path="./assets/animations/success.json" />
 </Layout>
</template>
const path = require('path');

module.exports = {

 configureWebpack: {
  module: {
   rules: [
     {
       type: 'javascript/auto',
       test: /\.json$/,
       include: [path.resolve(__dirname, 'src/assets/animations')],
       use: [
         {
           loader: 'file-loader',
         },
       ],
    },
  ],
 },
},