Skip to content

treeandgrass/buildedassets-upload-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

buildedassets-upload-webpack-plugin

Upload the webpack packaged file to cdn or some other place

webpack3/4 | node.js v8 above

Install

npm i -D buildedassets-upload-webpack-plugin

Usage

plugins: [
    new UploadPlugin({
      filterExts: ['.js'],
      delayTime: 1000,
      fileUpload: {
        upload(paths, callback) {
          /* callback(paths) */
        },
        callback(args) {
          /* console.log(args)*/
        }
      }
    })
  ]

!important If you do not pass the fileUpload object, default use netease nos sdk to upload the file to nos. You need to refer to the following document configuration

new UploadPlugin({
     filterExts: ['.js'],
     root: './dist',
     delayTime: 1000,
     accessId: 'id',
     secretKey: '',
     endpoint: '',
     port: 80,
     bucket: 'bucket'
})

Description

fileUpload is an object, which contains two methods, one is the upload method of the upload file, the other is the callback method, the first parameter of the upload is the file path packaged by webpack, and the second parameter is the callback method, the parameter is fileUpload callback method

About

Upload the webpack packaged resource file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published