filemanager-webpack-plugin icon indicating copy to clipboard operation
filemanager-webpack-plugin copied to clipboard

How to package dist to realize dual directory

Open xqhmz opened this issue 3 years ago • 8 comments

How to package dist to realize dual directory example: dist.zip/dist/css

image

xqhmz avatar Mar 23 '22 06:03 xqhmz

Can you elaborate? I couldn't understand whats needed.

sibiraj-s avatar Mar 26 '22 04:03 sibiraj-s

Screenshots are not helpful. Please describe with some detail.

sibiraj-s avatar Apr 09 '22 05:04 sibiraj-s

Maybe he means that he wants to remove the dist directory from the zip package and only package the dist subdirectory

daoxincc avatar Apr 15 '22 02:04 daoxincc

Maybe he means that he wants to remove the dist directory from the zip package and only package the dist subdirectory

On the contrary,I hope package the dist directory and the dist subdirectory,now it dose not has the dist directory only has the dist subdirectory

const FileManagerPlugin = require('filemanager-webpack-plugin');
const path = require("path");

module.exports = {
   configureWebpack:{
       resolve:{
          extensions:['.js', '.json', '.vue', '.scss', '.css'],
          alias: {
              "@": path.resolve(__dirname, "./src"),
              "@c": path.resolve(__dirname, "./src/common")
          }
       }
       plugins:[
          new FileManagerPlugin({
             onEnd:{
                delete:["./dist.zip"],
                archive:[{source: "./dist", destination: "./dist.zip"}]
             }
          })
       ]
   }
}

xqhmz avatar Apr 15 '22 02:04 xqhmz

cool, it works

daoxincc avatar Apr 15 '22 02:04 daoxincc

I think that's his want.thanks

daoxincc avatar Apr 15 '22 02:04 daoxincc

Ah. That was the intended behaviour. If you want source directory to be a part of the output archive as well. then you could move it into another directory and zip that.

sibiraj-s avatar May 07 '22 08:05 sibiraj-s

Ah.I want it also.so what should i do?the mthod move is not easy.

parkerisme avatar Jun 29 '22 11:06 parkerisme

99

我想压缩后保留dist目录以及子文件,但是不行

Justice996 avatar May 05 '23 08:05 Justice996

99

我想压缩后保留dist目录以及子文件,但是不行

The same with me.

joket1999 avatar Jun 17 '23 09:06 joket1999

You could do the following. onEnd accepts an array and guarantees order of execution.

{
  "onEnd": [
    {
      "copy": [{ "source": "./dist", "destination": "./someFolder/dist" }]
    },
    {
      "archive": [
        { "source": "./someFolder/", "destination": "..somelocation.zip" }
      ]
    }
  ]
}

Closing this as there is a way to solve this.

sibiraj-s avatar Jul 01 '23 14:07 sibiraj-s