最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Vue?FileManagerPlugin?報(bào)錯(cuò)問(wèn)題及解決

 更新時(shí)間:2022年10月14日 09:45:25   作者:李二茍  
這篇文章主要介紹了Vue?FileManagerPlugin?報(bào)錯(cuò)問(wèn)題及解決,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

Vue FileManagerPlugin 報(bào)錯(cuò)

項(xiàng)目場(chǎng)景

vue build時(shí)想直接打包輸出成zip

問(wèn)題描述 

按照如下官方文檔內(nèi)寫(xiě)法, 提示出

Invalid actions object. FileManagerPlugin has been initialized using an actions object that does not match the API schema

const FileManagerPlugin = require('filemanager-webpack-plugin');
 
module.exports = {
  ...
  ...
  plugins: [
    new FileManagerPlugin({
      onEnd: {
        copy: [
          { source: '/path/from', destination: '/path/to' },
          { source: '/path/**/*.js', destination: '/path' },
          { source: '/path/fromfile.txt', destination: '/path/tofile.txt' },
          { source: '/path/**/*.{html,js}', destination: '/path/to' },
          { source: '/path/{file1,file2}.js', destination: '/path/to' },
          { source: '/path/file-[hash].js', destination: '/path/to' }
        ],
        move: [
          { source: '/path/from', destination: '/path/to' },
          { source: '/path/fromfile.txt', destination: '/path/tofile.txt' }
        ],
        delete: [
         '/path/to/file.txt',
         '/path/to/directory/'
        ],
        mkdir: [
         '/path/to/directory/',
         '/another/directory/'
        ],
        archive: [
          { source: '/path/from', destination: '/path/to.zip' },
          { source: '/path/**/*.js', destination: '/path/to.zip' },
          { source: '/path/fromfile.txt', destination: '/path/to.zip' },
          { source: '/path/fromfile.txt', destination: '/path/to.zip', format: 'tar' },
          { 
             source: '/path/fromfile.txt', 
             destination: '/path/to.tar.gz', 
             format: 'tar',
             options: {
               gzip: true,
               gzipOptions: {
                level: 1
               },
               globOptions: {
                nomount: true
               }
             }
           }
 
        ]
      }
    })
  ],
  ...
}

原因分析

直接去npm里去查文檔, 看到了這個(gè)??!!

結(jié)構(gòu)變了!

解決方案

好了既然知道問(wèn)題,解決方案有兩種

1.用老版本~

npm i filemanager-webpack-plugin@2.0.5

2.用新版本

具體如何使用參考文檔~~

npm文檔地址:https://www.npmjs.com/package/filemanager-webpack-plugin/v/3.1.0

Vue配置filemanager-webpack-plugin報(bào)錯(cuò)

安裝包版本:"filemanager-webpack-plugin": "^7.0.0-beta.0",

正確配置方式

const FileManagerPlugin = require('filemanager-webpack-plugin') // 引入
const packageName = 'dist'
chainWebpack(config) {
     config.plugin('fileManager')
      .use(FileManagerPlugin).tap(args => [{
        events: {
          onEnd: {
            delete: [ // 首先需要?jiǎng)h除項(xiàng)目根目錄下的dist.zip
              `./${packageName}.zip`
            ],
            archive: [ // 選擇文件夾將之打包成xxx.zip并放在根目錄
              { source: `./${packageName}`, destination: `./${packageName}.zip` }
            ]
          }
        }
     }])
}

以上配置,可以解決以下問(wèn)題

1.TypeError: config.plugins.push is not a function

2. ERROR  ValidationError: Invalid actions object. FileManagerPlugin has been initialized using an actions object that does not match the API schema.
 - actions has an unknown property 'onEnd'. These properties are valid:
   object { events?, runTasksInSeries?, context?, runOnceInWatchMode? }

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Vue組件中slot的用法

    Vue組件中slot的用法

    這篇文章交詳細(xì)的給大家介紹了vue組件中slot的用法,主要是讓組件的可擴(kuò)展性更強(qiáng),具體內(nèi)容詳情大家參考下本文
    2018-01-01
  • elementui時(shí)間/日期選擇器選擇禁用當(dāng)前之前(之后)時(shí)間代碼實(shí)例

    elementui時(shí)間/日期選擇器選擇禁用當(dāng)前之前(之后)時(shí)間代碼實(shí)例

    當(dāng)我們?cè)谶M(jìn)行網(wǎng)頁(yè)開(kāi)發(fā)時(shí),通常需要用到一些日期組件來(lái)方便用戶選擇時(shí)間,其中element日期組件是一個(gè)非常好用的工具,這篇文章主要給大家介紹了關(guān)于elementui時(shí)間/日期選擇器選擇禁用當(dāng)前之前(之后)時(shí)間的相關(guān)資料,需要的朋友可以參考下
    2024-02-02
  • 一步步帶你用vite簡(jiǎn)單搭建ts+vue3全家桶

    一步步帶你用vite簡(jiǎn)單搭建ts+vue3全家桶

    Vue3與TS的聯(lián)合是大趨勢(shì),下面這篇文章主要給大家介紹了關(guān)于用vite簡(jiǎn)單搭建ts+vue3全家桶的相關(guān)資料,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-07-07
  • VUE中的export default和export使用方法解析

    VUE中的export default和export使用方法解析

    export default和export都能導(dǎo)出一個(gè)模塊里面的常量,函數(shù),文件,模塊等,在其它文件或模塊中通過(guò)import來(lái)導(dǎo)入常量,函數(shù),文件或模塊。但是,在一個(gè)文件或模塊中export,import可以有多個(gè),export default卻只能有一個(gè)。
    2022-12-12
  • 前端VUE雙語(yǔ)實(shí)現(xiàn)方案詳細(xì)教程

    前端VUE雙語(yǔ)實(shí)現(xiàn)方案詳細(xì)教程

    在項(xiàng)目需求中我們會(huì)遇到國(guó)際化的中英文切換,這篇文章主要給大家介紹了關(guān)于前端VUE雙語(yǔ)實(shí)現(xiàn)方案的相關(guān)資料,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2024-08-08
  • Vue-cli3項(xiàng)目引入Typescript的實(shí)現(xiàn)方法

    Vue-cli3項(xiàng)目引入Typescript的實(shí)現(xiàn)方法

    這篇文章主要介紹了Vue-cli3項(xiàng)目引入Typescript的實(shí)現(xiàn)方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-10-10
  • Vuex(多組件數(shù)據(jù)共享的Vue插件)搭建與使用

    Vuex(多組件數(shù)據(jù)共享的Vue插件)搭建與使用

    Vuex是實(shí)現(xiàn)組件全局狀態(tài)(數(shù)據(jù))管理的一種機(jī)制,可以方便的實(shí)現(xiàn)組件之間數(shù)據(jù)的共享,數(shù)據(jù)緩存等等,下面這篇文章主要給大家介紹了關(guān)于Vuex(多組件數(shù)據(jù)共享的Vue插件)搭建與使用的相關(guān)資料,需要的朋友可以參考下
    2022-10-10
  • Vue組件基礎(chǔ)操作介紹

    Vue組件基礎(chǔ)操作介紹

    這篇文章主要介紹了Vue組件基礎(chǔ)操作,組件是vue.js最強(qiáng)大的功能之一,而組件實(shí)例的作用域是相互獨(dú)立的,這就意味著不同組件之間的數(shù)據(jù)無(wú)法相互進(jìn)行直接的引用
    2023-01-01
  • VUE使用vuex解決模塊間傳值問(wèn)題的方法

    VUE使用vuex解決模塊間傳值問(wèn)題的方法

    本篇文章主要介紹了VUE使用vuex解決模塊間傳值問(wèn)題 ,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-06-06
  • vue+element下日期組件momentjs轉(zhuǎn)換賦值問(wèn)題解決

    vue+element下日期組件momentjs轉(zhuǎn)換賦值問(wèn)題解決

    這篇文章主要介紹了vue+element下日期組件momentjs轉(zhuǎn)換賦值問(wèn)題,記錄下使用momentjs轉(zhuǎn)換日期字符串賦值給element的日期組件報(bào)錯(cuò)問(wèn)題,需要的朋友可以參考下
    2024-02-02

最新評(píng)論

淮安市| 门源| 荆州市| 闻喜县| 许昌县| 嫩江县| 长春市| 蓬溪县| 苏尼特左旗| 屏山县| 宜君县| 新巴尔虎右旗| 南充市| 托里县| 兴国县| 高碑店市| 渝中区| 溧阳市| 确山县| 江山市| 绍兴县| 阜新市| 和林格尔县| 大英县| 太湖县| 屏东县| 玛多县| 平远县| 瑞安市| 平顺县| 沙湾县| 乐陵市| 吉林市| 平原县| 永宁县| 高邮市| 兴业县| 清徐县| 五华县| 故城县| 禹州市|