美文网首页
FileManager Webpack Plugin

FileManager Webpack Plugin

作者: Madfish | 来源:发表于2021-04-21 16:56 被阅读0次
    npm install filemanager-webpack-plugin --save-dev
    # or
    yarn add filemanager-webpack-plugin --dev
    
    // webpack.config.js:
    // vue.config.js
    const FileManagerPlugin = require('filemanager-webpack-plugin');
    
    module.exports = {
      plugins: [
        new FileManagerPlugin({
          events: {
            onEnd: {
              copy: [
                { source: '/path/fromfile.txt', destination: '/path/tofile.txt' },
                { source: '/path/**/*.js', destination: '/path' },
              ],
              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,
                    },
                  },
                },
              ],
            },
          },
        }),
      ],
    };
    

    相关文章

      网友评论

          本文标题:FileManager Webpack Plugin

          本文链接:https://www.haomeiwen.com/subject/todzlltx.html