2.0.1 • Published 2 years ago

@winman-f2e/nos-loader v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

nos-loader

加载模块的方式是将文件上传并返回URL

使用

$ npm install @winman-f2e/nos-loader

// webpack.config.js

const nosUpload = {} // http://doc.hz.netease.com/pages/viewpage.action?pageId=105043442


module.exports = {
    rules: [
        {
            test: /\.(png|jpe?g|gif|svg|woff2?|eot|ttf|otf)(\?.*)?$/,
            loader: '@winman-f2e/nos-loader',
            query: {
                nosUpload
            }
        }
    ]
}

nosUpload格式:

{
    accessKey: '',
    accessSecret: '',
    host: '',
    protocol: '',
    endpoint: '',
    defaultBucket: '',
    objectOrigin: ''
}