VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined

简介: VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined

前言

vue项目执行npm run dev的时候filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined

具体信息如下:

if (isGlob) archive.glob(command.source, command.options.globOptions || {});else if (sStats.isFile()) archive.file(command.source, { name: path.basename(command.source) });else if (sStats.isDirectory()) archi
ve.directory(command.source, false);
                                                                                                                ^
TypeError: Cannot read property 'isFile' of undefined

内容

报错的原因很简单因为我们才拉下来的项目是没有dist目录的,然后filemanager-webpack-plugin去找个dist目录发现竟然不存在,然后就罢工不干了,导致出错;

解决方法,修改下配置,运行的时候自动创建下dist目录,就阔以了;

plugins: [
    new FileManagerWebpackPlugin ({
      onEnd: {
        mkdir: ['./dist'],
        delete: [
          './dist.zip',
        ],
        archive: [
          {source: './dist', destination: './dist.zip'},
        ]
      }
    })
  ],

学无止境,谦卑而行.

目录
打赏
0
0
0
0
67
分享
相关文章
Vue 开发中的一些问题简单记录,Cannot find module ‘webpack/lib/RuleSet‘
Vue 开发中的一些问题简单记录,Cannot find module ‘webpack/lib/RuleSet‘
874 1
报错:Cannot read properties of undefined (reading ‘$message‘)解决方法
以上就是解决"Cannot read properties of undefined (reading ‘$message‘)"错误的几种方法,希望对你有所帮助。
5620 0
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
736 0
成功解决:Cannot read properties of undefined (reading ‘commit‘)
这篇文章提供了解决Vuex中"Cannot read properties of undefined (reading 'commit')"错误的两种方法:检查模板中的数据属性是否存在,以及确保在Vue实例中正确挂载了store对象。
成功解决:Cannot read properties of undefined (reading ‘commit‘)
Echarts——Invalid geoJson format Cannot read property 'length' of undefined
Echarts——Invalid geoJson format Cannot read property 'length' of undefined
171 0
VUE——Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
VUE——Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
252 0
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等