aliyun-oss-webpack-plugin
Aliyun OSS suports for webpack
Last updated 2 years ago by xuyuanxiang .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install aliyun-oss-webpack-plugin 
SYNC missed versions from official npm registry.

put all bundles except HTML to your aliyun oss.

Installation

webpack 4.x:

npm install aliyun-oss-webpack-plugin --save

webpack 2.x || 3.x:

npm install aliyun-oss-webpack-plugin@"^2.0.1" --save

Configuration

const AliyunOSSPlugin = require("aliyun-oss-webpack-plugin");
module.exports = {
    output: {
        publicPath: "https://domain.com/p/a/t/h" // !required
    },
    plugins: [
        new AliyunOSSPlugin({
            accessKeyId: '*****',
            accessKeySecret: '*****',
            region: 'oss-cn-hangzhou',
            bucket: '*****',
            headers: {
              'Cache-Control': 'max-age=3600'
            }
        })
    ]
}

Example

webpack.config.js:

const path = require('path');
const AliyunOSSPlugin = require("aliyun-oss-webpack-plugin");

module.exports = {
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, './public'),
        filename: 'index.js',
        publicPath: 'https://my.static.assets.domain/my-project/1.0.0/',
    },
    plugins: [
        new AliyunOSSPlugin({
            accessKeyId: '*****',
            accessKeySecret: '*****',
            region: 'oss-cn-hangzhou',
            bucket: '*****',
            headers: {
              'Cache-Control': 'max-age=3600',
            },
        })
    ]
}

index.html:

<script src="https://my.static.assets.domain/my-project/1.0.0/index.js"></script>

Current Tags

  • 3.0.2                                ...           latest (2 years ago)

5 Versions

  • 3.0.2                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 4
This Week 35
This Month 35
Last Day 4
Last Week 43
Last Month 152
Dependencies (4)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |