All Projects → skyujilong → Tinypng Webpack Plugin

skyujilong / Tinypng Webpack Plugin

Licence: mit
a tinyPNG plugin for webpack

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Tinypng Webpack Plugin

Moment Locales Webpack Plugin
Easily remove unused Moment.js locales with webpack
Stars: ✭ 396 (+1177.42%)
Mutual labels:  webpack-plugin
Webpack Config Plugins
Provide best practices for webpack loader configurations
Stars: ✭ 529 (+1606.45%)
Mutual labels:  webpack-plugin
Error Overlay Webpack Plugin
Catch errors with style 💥✨
Stars: ✭ 821 (+2548.39%)
Mutual labels:  webpack-plugin
Mini Css Extract Plugin
Lightweight CSS extraction plugin
Stars: ✭ 4,396 (+14080.65%)
Mutual labels:  webpack-plugin
Babel Minify Webpack Plugin
[DEPRECATED] Babel Minify Webpack Plugin
Stars: ✭ 502 (+1519.35%)
Mutual labels:  webpack-plugin
Duplicate Package Checker Webpack Plugin
🕵️ Webpack plugin that warns you when a build contains multiple versions of the same package
Stars: ✭ 635 (+1948.39%)
Mutual labels:  webpack-plugin
Browser Sync Webpack Plugin
Easily use BrowserSync in your Webpack project.
Stars: ✭ 356 (+1048.39%)
Mutual labels:  webpack-plugin
Webpack Common Shake
CommonJS Tree Shaker plugin for WebPack
Stars: ✭ 875 (+2722.58%)
Mutual labels:  webpack-plugin
Optimize Plugin
Optimized Webpack Bundling for Everyone. Intro ⤵️
Stars: ✭ 525 (+1593.55%)
Mutual labels:  webpack-plugin
Karma Webpack
Karma webpack Middleware
Stars: ✭ 818 (+2538.71%)
Mutual labels:  webpack-plugin
Webpack Parallel Uglify Plugin
A faster uglifyjs plugin.
Stars: ✭ 456 (+1370.97%)
Mutual labels:  webpack-plugin
Offline Plugin
Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
Stars: ✭ 4,444 (+14235.48%)
Mutual labels:  webpack-plugin
Purgecss
Remove unused CSS
Stars: ✭ 6,566 (+21080.65%)
Mutual labels:  webpack-plugin
Extract Text Webpack Plugin
[DEPRECATED] Please use https://github.com/webpack-contrib/mini-css-extract-plugin Extracts text from a bundle into a separate file
Stars: ✭ 4,071 (+13032.26%)
Mutual labels:  webpack-plugin
Prerender Spa Plugin
Prerenders static HTML in a single-page application.
Stars: ✭ 7,018 (+22538.71%)
Mutual labels:  webpack-plugin
Webpack Chrome Extension Reloader
🔥 Hot reloading while developing Chrome extensions with webpack 🔥
Stars: ✭ 365 (+1077.42%)
Mutual labels:  webpack-plugin
Webpack Deep Scope Analysis Plugin
A webpack plugin for deep scope analysis
Stars: ✭ 589 (+1800%)
Mutual labels:  webpack-plugin
Event Hooks Webpack Plugin
Event hooks plugin for webpack
Stars: ✭ 30 (-3.23%)
Mutual labels:  webpack-plugin
Cloudflare Workers Webpack Plugin
Launch Cloudflare Workers to the Edge from the comfort of your build step 🚀
Stars: ✭ 18 (-41.94%)
Mutual labels:  webpack-plugin
Purifycss Webpack
UNMAINTAINED, use https://github.com/FullHuman/purgecss-webpack-plugin
Stars: ✭ 789 (+2445.16%)
Mutual labels:  webpack-plugin

tinypng-webpack-plugin

a img compress plugin use with tinyPNG for webpack.

Get TinyPNG key

link

Installation

# for webpack 4
$ npm install tinypng-webpack-plugin --save-dev

# for webpack 3 & 2 & 1
$ npm install [email protected] --save-dev

Example Webpack Config

var tinyPngWebpackPlugin = require('tinypng-webpack-plugin');

    //in your webpack plugins array
    module.exports = {
      plugins: [
          new tinyPngWebpackPlugin({
              key:"your tinyPNG key"
          })
      ]
    }

Usage

new tinyPngWebpackPlugin({
    key:"your tinyPNG key",//can be Array, eg:['your key 1','your key 2'....]
    ext: ['png', 'jpeg', 'jpg'],//img ext name
    proxy:'http://user:[email protected]:8080'//http proxy,eg:如果你来自中国,同时拥有shadowsocks,翻墙默认配置为 http:127.0.0.1:1080 即可。(注,该参数因为需要超时断开连接的原因,导致最后会延迟执行一会webpack。但相对于国内网络环境,用此参数还是非常划算的,测试原有两张图片,无此参数耗时2000ms+,有此参数耗时1000ms+节约近半。)
})

Options Description

  • key: Required, tinyPNG key
  • ext: not Required, to be compress img ext name.
  • proxy:not Required, a http proxy to improve the network environment.eg:http://127.0.0.1:1080

Defaults Options

    {
        key:'',
        ext: ['png', 'jpeg', 'jpg'],
        proxy:''
    }

License

http://www.opensource.org/licenses/mit-license.php

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].