package
a browserify plugin that runs various optimizations, so you don't have to install them all manually.
npm install tinyifyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
a browserify plugin that runs various optimizations, so you don't have to install them all manually.
npm install --save-dev tinyify
browserify -p tinyify app.jsassert() callsNODE_ENV with "production"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 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 @browserify/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: falseDisable 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 })If you need further customisation, I recommend installing the tools separately instead:
npm install --save-dev unassertify @browserify/envify @browserify/uglifyify common-shakeify browser-pack-flat terser
browserify entry.js \
-g unassertify \
-g @browserify/envify \
-g @browserify/uglifyify \
-p common-shakeify \
-p browser-pack-flat/plugin \
| terser -cm \
> output.jsOr with the Node API:
browserify('entry.js')
.transform('unassertify', { global: true })
.transform('@browserify/envify', { global: true })
.transform('@browserify/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.
gkatsev
me@gkatsev.com
maxogden
max@maxogden.com
thlorenz
thlorenz10@gmail.com
terinjokes
terinjokes@gmail.com
jmm
npm-public@jessemccarthy.net
mellowmelon
palmermebane@gmail.com
ashaffer88
darawk@gmail.com
balupton
b@lupton.cc
cwmma
calvin.metcalf@gmail.com
jprichardson
jprichardson@gmail.com
indutny
blackhole@livebox.sh
jryans
jryans@gmail.com
sethvincent
sethvincent@gmail.com
yoshuawuyts
javascript@yosh.is
ungoldman
ungoldman@gmail.com
ahdinosaur
michael.williams@enspiral.com
elnounch
contact@elnounch.net
parshap
parshap+npm@gmail.com
yerkopalma
yerko.palma@usach.cl
forbeslindesay
forbes@lindesay.co.uk
leichtgewicht
martin.heidegger@gmail.com
garann
garann@gmail.com
bret
bcomnes@gmail.com
anandthakker
vestibule@anandthakker.net
mattdesl
dave.des@gmail.com
hughsk
hughskennedy@gmail.com
fpereira1
pereira.filype@gmail.com
goto-bus-stop
renee@kooi.me
bpostlethwaite
post.ben.here@gmail.com
emilbayes
github@tixz.dk
stevemao
maochenyan@gmail.com
pkrumins
peteris.krumins@gmail.com
tehshrike
me@JoshDuff.com
defunctzombie
shtylman@gmail.com
lukechilds
lukechilds123@gmail.com
raynos
raynos2@gmail.com
toddself
todd@selfassembled.org
--no-flat option, bundle-collapser replaces file paths in require() calls with short module IDsEstimated unpacked size across 65 packages.
6.3 MB+
Includes dependencies.
10 direct · 2 outdated
3.16.1
5.51.2
^4.0.2
5.0.12
^1.0.0
1.0.0
^3.0.1
3.0.1
^2.0.1
2.1.0
^6.0.0
6.0.0
^6.0.0
6.0.0