All Projects → lyfeyaj → qn-webpack

lyfeyaj / qn-webpack

Licence: MIT license
Qiniu webpack plugin (七牛 Webpack 插件)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to qn-webpack

Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+6769.23%)
Mutual labels:  webpack-plugin
spring-file-storage-service
The FSS(file storage service) APIs make storing the blob file easy and simple .
Stars: ✭ 33 (-15.38%)
Mutual labels:  qiniu
image-minimizer-webpack-plugin
Webpack loader and plugin to compress images using imagemin
Stars: ✭ 180 (+361.54%)
Mutual labels:  webpack-plugin
Webpack Shell Plugin
Run shell commands either before or after webpack builds
Stars: ✭ 250 (+541.03%)
Mutual labels:  webpack-plugin
webpack-extract-translation-keys
This plugin extracts translation keys for applications requiring runtime translations
Stars: ✭ 35 (-10.26%)
Mutual labels:  webpack-plugin
webpack-omit-js-for-css-plugin
This plugin will omit bundled JS files for dependencies that are exclusively CSS, which become obsolete once mini-css-extract-plugin extracts inlined CSS into its own .css file
Stars: ✭ 14 (-64.1%)
Mutual labels:  webpack-plugin
Hard Source Webpack Plugin
www.npmjs.com/package/hard-source-webpack-plugin
Stars: ✭ 2,608 (+6587.18%)
Mutual labels:  webpack-plugin
crx-webpack-plugin
A webpack plugin to package chrome extensions (crx) post build
Stars: ✭ 21 (-46.15%)
Mutual labels:  webpack-plugin
qiniu-auto-cert
七牛 CDN 证书自动化工具
Stars: ✭ 20 (-48.72%)
Mutual labels:  qiniu
pxtorem-webpack-plugin
A webpack plugin for generating rem for stylesheet and inject auto calculate scripts.
Stars: ✭ 24 (-38.46%)
Mutual labels:  webpack-plugin
nunjucks-webpack-plugin
A webpack plugin for nunjucks.
Stars: ✭ 27 (-30.77%)
Mutual labels:  webpack-plugin
webpack-bugsnag-plugins
Webpack plugins for common Bugsnag actions.
Stars: ✭ 29 (-25.64%)
Mutual labels:  webpack-plugin
eruda-webpack-plugin
A webpack plugin of eruda to help you develop mobile app
Stars: ✭ 56 (+43.59%)
Mutual labels:  webpack-plugin
Webpack Messages
Beautifully format Webpack messages throughout your bundle lifecycle(s)!
Stars: ✭ 238 (+510.26%)
Mutual labels:  webpack-plugin
del-webpack-plugin
A file plugin help you remove old files after webpack (v5) bundling
Stars: ✭ 43 (+10.26%)
Mutual labels:  webpack-plugin
Critters
🦔 A Webpack plugin to inline your critical CSS and lazy-load the rest.
Stars: ✭ 2,894 (+7320.51%)
Mutual labels:  webpack-plugin
sitemap-webpack-plugin
Webpack plugin to generate a sitemap.
Stars: ✭ 72 (+84.62%)
Mutual labels:  webpack-plugin
webpack-demos
webpack小练习
Stars: ✭ 17 (-56.41%)
Mutual labels:  webpack-plugin
vscode-qiniu-upload-image
一个VS Code插件,写Markdown时可以快捷上传本地图片获取七牛图床外链。
Stars: ✭ 87 (+123.08%)
Mutual labels:  qiniu
asset-map-webpack-plugin
Webpack plugin that creates a map of assets to public url slug for server agnostic usage.
Stars: ✭ 14 (-64.1%)
Mutual labels:  webpack-plugin

Qiniu Webpack Plugin

上传 Webpack Assets 至 七牛 CDN

前提

需要 Node 版本在 v4.0 以上

安装

使用方法

支持的配置项:

  • accessKey 七牛 AccessKey
  • secretKey 七牛 SecretKey
  • bucket 七牛存储对象名称
  • path 存储路径, 默认为 [hash],也可以指定 hash 长度,如: [hash:8]
  • exclude 可选,排除特定文件,正则表达式,如: /index\.html$/
  • include 可选,指定要上传的文件,正则表达式,如: /app\.js$/
  • maxRetryTimes 可选,最大重试次数,默认 3
  • batch 可选,批量上传文件并发数,默认 20
  • zone 可选,存储在七牛的机房(华东 Zone_z0、华北 Zone_z1、华南 Zone_z2、北美 Zone_na0

注: Webpack 的 output.publicPath 要指向七牛云(或自定义的)域名地址

// 引入
const QiniuPlugin = require('qn-webpack');

// 配置 Plugin
const qiniuPlugin = new QiniuPlugin({
  accessKey: 'my-access-key',
  secretKey: 'my-secret-key',
  bucket: 'my-bucket',
  path: '[hash]/'
});

// Webpack 的配置
module.exports = {
 output: {
    // 此处为七牛提供的域名(http://7xqhak.com1.z0.glb.clouddn.com) 加上 path([hash]/)
    publicPath: "http://7xqhak.com1.z0.glb.clouddn.com/[hash]/"
    // ...
 },
 plugins: [
   qiniuPlugin
   // ...
 ]
 // ...
}

效果图

无图无真相 ^_^

Preview

License

The MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].