aliyun-oss-loader

0.1.6 • Public • Published

aliyun-oss-loader

a webpack loader for uploading files to aliyun oss

v dw dm dy l

usage

  • npm install aliyun-oss-loader --save-dev

  • set config in your webpack file

    module: {
        loaders: [
            {
                test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
                loader: 'aliyun-oss-loader',
                options: {
                    region: 'xxxxxxxxx',
                    bucket: 'xxxxxx',
                    accessKeyId: 'xxxxx',
                    accessKeySecret: 'xxxx',
                    name: 'folder/[name].[hash].[ext]',
                    https: true,
                    domain: 'img.xxx.com'
                }
            }
        ]
    }

params

  • region

    • String Required
  • bucket

    • String Required
  • accessKeyId

    • String Required
  • accessKeySecret

    • String Required
  • name

    • String Optional default '[name].[hash].[ext]'
  • https

    • Boolean Optional default false
  • domain

    • String Optional support customize domain name

Package Sidebar

Install

npm i aliyun-oss-loader

Weekly Downloads

3

Version

0.1.6

License

WTFPL

Last publish

Collaborators

  • zhangdeyu