Skip to content

Commit

Permalink
chore: documented the --no-compress option (#317)
Browse files Browse the repository at this point in the history
Co-authored-by: Ward Peeters <[email protected]>
  • Loading branch information
mweststrate and wardpeet authored Aug 16, 2020
1 parent 5881387 commit dfa25e0
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ In addition to the above formats, Microbundle also outputs a `modern` bundle spe
```js
// Our source, "src/make-dom.js":
export default async function makeDom(tag, props, children) {
let el = document.createElement(tag);
el.append(...(await children));
return Object.assign(el, props);
let el = document.createElement(tag);
el.append(...(await children));
return Object.assign(el, props);
}
```

Expand All @@ -80,22 +80,26 @@ Compiling the above using Microbundle produces the following `modern` and `esm`

```js
export default async function(e, t, a) {
let n = document.createElement(e);
n.append(...await a);
return Object.assign(n, t);
let n = document.createElement(e);
n.append(...(await a));
return Object.assign(n, t);
}
```

</td><td>

```js
export default function(e, t, r) { try {
var n = document.createElement(e);
return Promise.resolve(r).then(function(e) {
n.append.apply(n, e);
return Object.assign(n, t);
});
} catch (e) { return Promise.reject(e) } }
export default function(e, t, r) {
try {
var n = document.createElement(e);
return Promise.resolve(r).then(function(e) {
n.append.apply(n, e);
return Object.assign(n, t);
});
} catch (e) {
return Promise.reject(e);
}
}
```

</td></tbody></table>
Expand Down Expand Up @@ -194,9 +198,9 @@ To achieve the smallest possible bundle size, libraries often wish to rename int

```json
{
"mangle": {
"regex": "^_"
}
"mangle": {
"regex": "^_"
}
}
```

Expand Down Expand Up @@ -229,6 +233,7 @@ Options
--define Replace constants with hard-coded values
--alias Map imports to different modules
--compress Compress output using Terser
--no-compress Disable output compressing
--strict Enforce undefined global context and add "use strict"
--name Specify name exposed in UMD and IIFE builds
--cwd Use an alternative working directory (default .)
Expand Down Expand Up @@ -276,5 +281,5 @@ Here's what's coming up for Microbundle:
[MIT](https://oss.ninja/mit/developit/)

[rollup]: https://github.com/rollup/rollup
[Babel]: https://babeljs.io/
[babel]: https://babeljs.io/
[async-to-promises]: https://github.com/rpetrich/babel-plugin-transform-async-to-promises

0 comments on commit dfa25e0

Please sign in to comment.