Skip to content

Commit dfa25e0

Browse files
chore: documented the --no-compress option (#317)
Co-authored-by: Ward Peeters <ward@coding-tech.com>
1 parent 5881387 commit dfa25e0

1 file changed

Lines changed: 22 additions & 17 deletions

File tree

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ In addition to the above formats, Microbundle also outputs a `modern` bundle spe
6363
```js
6464
// Our source, "src/make-dom.js":
6565
export default async function makeDom(tag, props, children) {
66-
let el = document.createElement(tag);
67-
el.append(...(await children));
68-
return Object.assign(el, props);
66+
let el = document.createElement(tag);
67+
el.append(...(await children));
68+
return Object.assign(el, props);
6969
}
7070
```
7171

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

8181
```js
8282
export default async function(e, t, a) {
83-
let n = document.createElement(e);
84-
n.append(...await a);
85-
return Object.assign(n, t);
83+
let n = document.createElement(e);
84+
n.append(...(await a));
85+
return Object.assign(n, t);
8686
}
8787
```
8888

8989
</td><td>
9090

9191
```js
92-
export default function(e, t, r) { try {
93-
var n = document.createElement(e);
94-
return Promise.resolve(r).then(function(e) {
95-
n.append.apply(n, e);
96-
return Object.assign(n, t);
97-
});
98-
} catch (e) { return Promise.reject(e) } }
92+
export default function(e, t, r) {
93+
try {
94+
var n = document.createElement(e);
95+
return Promise.resolve(r).then(function(e) {
96+
n.append.apply(n, e);
97+
return Object.assign(n, t);
98+
});
99+
} catch (e) {
100+
return Promise.reject(e);
101+
}
102+
}
99103
```
100104

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

195199
```json
196200
{
197-
"mangle": {
198-
"regex": "^_"
199-
}
201+
"mangle": {
202+
"regex": "^_"
203+
}
200204
}
201205
```
202206

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

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

0 commit comments

Comments
 (0)