a webpack loader for uploading files to aliyun oss
-
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'
}
}
]
}
-
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
-