@winman-f2e/html-webpack-nos-plugin

2.0.10 • Public • Published

html-webpack-nos-plugin

将打包后的静态资源上传至nos

使用

$ npm install @winman-f2e/html-webpack-nos-plugin

// webpack.config.js

const HtmlWebpackNosPlugin = require('@winman-f2e/html-webpack-nos-plugin')
// nos配置请查看内部wiki文档及@winman-f2e/nos-upload的npm文档
// 配置字段含义参照[`@xgheaven/nos-node-sdk`](https://www.npmjs.com/package/@xgheaven/nos-node-sdk)
const nosUpload = {
    accessKey: 'your-access-key',
    accessSecret: 'your-access-secret',
    host: 'nosdn.127.net',
    protocol: 'https',
    endpoint: 'https://easyreadfs.nosdn.127.net',
    defaultBucket: 'easyreadfs',
    objectOrigin: 'https://easyreadfs.nosdn.127.net',
} 
moudule.exports = {
    plugins: [
        new HtmlWebpackNosPlugin({
            nosUpload,
            retryCount: 3, // 上传失败重试次数,默认为3,可不传
            excludes: ['.html', '.ftl'], // 定义哪些文件不需要上传(后缀名匹配),默认不处理以`.html`, `.ftl`为后缀名的资源。
            prefix: 'projectName' // NOS上的文件夹名, 默认将每次打包时的时间戳作为文件夹名。
            output: false // 是否在本地生成已上传的文件,默认不生成。
        })
    ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i @winman-f2e/html-webpack-nos-plugin

Weekly Downloads

2

Version

2.0.10

License

MIT

Unpacked Size

4.05 kB

Total Files

3

Last publish

Collaborators

  • luofeiyue
  • whiskeyi
  • yousy
  • guoyeeg
  • azgaga
  • liushichuan
  • yaochen
  • shenyuan
  • aflyermin
  • ignous
  • jeekdong