All Projects β†’ browserify β†’ Tinyify

browserify / Tinyify

Licence: other
a browserify plugin that runs various optimizations, so you don't have to install them all manually. makes your bundles tiny!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Tinyify

Common Shakeify
browserify tree shaking plugin using `common-shake`
Stars: ✭ 101 (-74.23%)
Mutual labels:  browserify, tree-shaking
Lyo
πŸ“¦ Node.js to browser - The easy way
Stars: ✭ 624 (+59.18%)
Mutual labels:  browserify, minify
frontend-starter-kit-with-gulp
Frontend Starter Kit with Gulp for either Themeforest Projects or customizable projects.
Stars: ✭ 34 (-91.33%)
Mutual labels:  minify, optimize
Simplifyify
A simplified Browserify and Watchify CLI
Stars: ✭ 37 (-90.56%)
Mutual labels:  browserify, minify
Serverless Plugin Optimize
Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript
Stars: ✭ 122 (-68.88%)
Mutual labels:  browserify, minify
webpack-json-access-optimizer
Webpack plugin to tree-shake and minify JSON modules
Stars: ✭ 34 (-91.33%)
Mutual labels:  minify, optimize
gatsby-plugin-optimize-svgs
A Gatsby Plugin to minify SVGs output to the filesystem during the build.
Stars: ✭ 39 (-90.05%)
Mutual labels:  minify, optimize
tuneta
Intelligently optimizes technical indicators and optionally selects the least intercorrelated for use in machine learning models
Stars: ✭ 77 (-80.36%)
Mutual labels:  optimize
Badge Size
🍻 Displays the size of a given file in your repository.
Stars: ✭ 277 (-29.34%)
Mutual labels:  minify
kirby-blade
Enable Laravel Blade Template Engine for Kirby 3
Stars: ✭ 20 (-94.9%)
Mutual labels:  minify
phaser-typescript-webpack
Another Phaser CE boilerplate using TypeScript and Webpack.
Stars: ✭ 17 (-95.66%)
Mutual labels:  minify
domain-browser
Node's domain module for the web browser
Stars: ✭ 30 (-92.35%)
Mutual labels:  browserify
React Dynamic Route Loading Es6
Auto chunking and dynamic loading of routes with React Router and Webpack 2
Stars: ✭ 297 (-24.23%)
Mutual labels:  tree-shaking
imagemin-power-cli
Optimize (compress) images with power using imagemin πŸ’ͺ
Stars: ✭ 13 (-96.68%)
Mutual labels:  minify
Mochify.js
β˜•οΈ TDD with Browserify, Mocha, Headless Chrome and WebDriver
Stars: ✭ 338 (-13.78%)
Mutual labels:  browserify
extendscript-starter
Starter project for extendscript-bundler + live reload capabilities
Stars: ✭ 26 (-93.37%)
Mutual labels:  browserify
Gulp Tutorial
Code examples for my Gulp.js tutorial series
Stars: ✭ 383 (-2.3%)
Mutual labels:  browserify
Compress Images
Minify size your images. Image compression with extension: jpg/jpeg, svg, png, gif. NodeJs
Stars: ✭ 331 (-15.56%)
Mutual labels:  minify
Uglifycss
Port of YUI CSS Compressor from Java to NodeJS
Stars: ✭ 259 (-33.93%)
Mutual labels:  minify
Commonjs Assert
Node.js's require('assert') for all engines
Stars: ✭ 255 (-34.95%)
Mutual labels:  browserify

tinyify

a browserify plugin that runs various optimizations, so you don't have to install them all manually.

npm travis standard

npm install --save-dev tinyify

browserify -p tinyify app.js

Included

  • unassertify - Remove assert() calls
  • envify - Replace environment variablesβ€”by default, replaces NODE_ENV with "production"
  • uglifyify - Remove dead code from modules
  • common-shakeify - Remove unused exports from modules
  • browser-pack-flat - Output a "flat" bundle, with all modules in a single scope
  • bundle-collapser - When using the --no-flat option, bundle-collapser replaces file paths in require() calls with short module IDs
  • minify-stream - Uglify the final bundle

browser-pack-flat and bundle-collapser are both not used if the --full-paths option is passed to Browserify. This way you can still get all of tinyify's other optimizations when building for disc.

Options

Options can be provided on the command line using subarg syntax, or in a separate options object using the browserify API.

env: {}

Supply custom environment variables for envify.

b.plugin('tinyify', {
  env: {
    PUBLIC_PATH: 'https://mywebsite.surge.sh/'
  }
})

This option is only available in the API. On the CLI, you can define environment variables beforehand instead:

PUBLIC_PATH=https://mywebsite.surge.sh browserify app.js -p tinyify

--no-flat, flat: false

Disable browser-pack-flat. This enables bundle-collapser instead which will still shrink the output bundle a bit by replacing file paths with short module IDs.

browserify app.js -p [ tinyify --no-flat ]
b.plugin('tinyify', { flat: false })

More options?

If you need further customisation, I recommend installing the tools separately instead:

npm install --save-dev unassertify envify uglifyify common-shakeify browser-pack-flat uglify-js
browserify entry.js \
  -g unassertify \
  -g envify \
  -g uglifyify \
  -p common-shakeify \
  -p browser-pack-flat/plugin \
| uglifyjs -cm \
> output.js

Or with the Node API:

browserify('entry.js')
    .transform('unassertify', { global: true })
    .transform('envify', { global: true })
    .transform('uglifyify', { global: true })
    .plugin('common-shakeify')
    .plugin('browser-pack-flat/plugin')
    .bundle()
    .pipe(require('minify-stream')({ sourceMap: false }))
    .pipe(fs.createWriteStream('./output.js'))

Alternatively you can fork this repo and publish it on npm under a scope with your modifications.

License

Apache-2.0

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