🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

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

Package Overview
Dependencies
Maintainers
11
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

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

latest
npmnpm
Version
2.0.10
Version published
Maintainers
11
Created
Source

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 // 是否在本地生成已上传的文件,默认不生成。
        })
    ]
}

FAQs

Package last updated on 30 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts