📦 Zero-configuration bundler for tiny modules.
preset-env
to 7.10 (#660)globals
generation when --external
values include dashes (#667, thanks @katywings!)--no-pkg-main
option for disabling filename inference (#658, thanks @katywings)import.meta
(#627, thanks @developit)--external
(#650, thanks @katywings)--no-compress
is enabled (#648, thanks @developit)declarationDir
option so it respects the cwd (#643) (#646, thanks @katywings)--externals
(#636 #628 #625 #609 #611 #614, thanks @gtrufitt, @developit, @SeanBannister, @adrienpoly & @i-like-robots)--format modern
(#413, thanks @JoviDeCroock & @marvinhagemeister)--define
can now replace expressions (#348, thanks @jviide)--css-modules
option controls whether .css
files are modular by default (#370, thanks @maraisr)"source"
package.json field can now be an Array (#372, thanks @maraisr)mangle.json
file path (#432, thanks @andrewiggins & @ForsakenHarmony).babelrc
is now detected and supported - it was previously ignored.--css-modules
option for *.css
files in addition to *.module.css
(#370, thanks @maraisr)--define @expression=replacement
(#588)for await ()
(#596).ts
entry modules (#587)New mangle.json
/ package.json
configuration for Terser!
{
// "minify" for Terser (https://github.com/terser-js/terser#minify-options-structure)
// Note: works as a key in both package.json or mangle.json
"minify": {
// Legacy/convenient way to set mangle.properties.{regex,reserved}:
"properties": "^_",
"reserved": ["_dom", "_constructor"],
// Optionally specify Terser compress configuration.
// Supported values: https://github.com/terser-js/terser#compress-options
"compress": {
"hoist_vars": true,
"reduce_funcs": false
},
// Optionally specify Terser mangle configuration
// Supported values: https://github.com/terser-js/terser#mangle-options
"mangle": {}
}
}
🐧 new --define
option! Inlines constants (great for Dead Code Elimination):
microbundle --define process.env.NODE_ENV=production,DEBUG=false
🐺 new --alias
option! Remap imports from one module to another:
microbundle --alias react=preact,react-dom=preact
🦊 Lovely refactoring from @MatiasOlivera and @ForsakenHarmony :)
🦑We turned minification up to 11!! (#321, thanks @jviide)