Skip to content

ChangbaFE/webpack-upload-alioss-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-upload-alioss-plugin

npm version

用于上传 webpack 生成的所有文件到阿里云 OSS 的 webpack 插件。本插件会自动缓存已经上传过的文件,不会重复上传,提高上传速度。

插件会设置好已上传文件的浏览器缓存和 CORS 设置。

安装

$ npm install webpack-upload-alioss-plugin --save-dev

使用

例子 webpack 配置:

webpack.config.js

const WebpackUploadAliossPlugin = require('webpack-upload-alioss-plugin');

module.exports = {
  plugins: [
    new WebpackUploadAliossPlugin({
      oss: {
        accessKeyId: '',
        accessKeySecret: '',
        bucket: '',
        urlPrefix: '',
        endpoint: ''
      }
    })
  ]
};

配置项

  • oss - 阿里云 OSS 配置信息
  • outputPath - 输出路径,默认插件会读取 webpack 的 outputPath 参数,如果你想指定上传到 OSS 文件的根路径,可以设置这个参数。

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%