You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can specify output builds in a `package.json` as follows:
@@ -108,16 +128,18 @@ You can specify output builds in a `package.json` as follows:
108
128
109
129
### Mangling Properties
110
130
111
-
Libraries often wish to rename internal object properties or class members to smaller names - transforming `this._internalIdValue` to `this._i`. Microbundle doesn't currently do this by default, but it can be enabled by adding a "mangle" property to your package.json, with a pattern to control when properties should be mangled. To mangle all property names beginning an underscore, add the following:
131
+
To achieve the smallest possible bundle size, libraries often wish to rename internal object properties or class members to smaller names - transforming `this._internalIdValue` to `this._i`. Microbundle doesn't do this by default, however it can be enabled by createing a `mangle.json` file (or a `"mangle"` property in your package.json). Within that file, you can specify a regular expression pattern to control which properties should be mangled. For example: to mangle all property names beginning an underscore:
112
132
113
133
```json
114
134
{
115
-
"mangle": {
116
-
"regex": "^_"
117
-
}
135
+
"mangle": {
136
+
"regex": "^_"
137
+
}
118
138
}
119
139
```
120
140
141
+
It's also possible to configure repeatable short names for each mangled property, so that every build of your library has the same output. **See the wiki for a [complete guide to property mangling in Microbundle](https://github.com/developit/microbundle/wiki/mangle.json).**
142
+
121
143
### All CLI Options
122
144
123
145
```
@@ -151,6 +173,7 @@ Options
151
173
--raw Show raw byte size (default false)
152
174
--jsx A custom JSX pragma like React.createElement (default: h)
153
175
--tsconfig Specify the path to a custom tsconfig.json
176
+
--css-modules Configures .css to be treated as modules (default: null)
154
177
-h, --help Displays this message
155
178
156
179
Examples
@@ -174,12 +197,16 @@ Here's what's coming up for Microbundle:
174
197
-[Preact](https://github.com/preactjs/preact) Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
175
198
-[Stockroom](https://github.com/developit/stockroom) Offload your store management to a worker easily.
176
199
-[Microenvi](https://github.com/fwilkerson/microenvi) Bundle, serve, and hot reload with one command.
200
+
-[Theme UI](https://github.com/system-ui/theme-ui) Build consistent, themeable React apps based on constraint-based design principles.
177
201
-[react-recomponent](https://github.com/philipp-spiess/react-recomponent) Reason-style reducer components for React using ES6 classes.
178
202
-[brazilian-utils](https://github.com/brazilian-utils/brazilian-utils) Utils library for specific Brazilian businesses.
179
203
-[react-hooks-lib](https://github.com/beizhedenglong/react-hooks-lib) A set of reusable react hooks.
180
204
-[mdx-deck-live-code](https://github.com/JReinhold/mdx-deck-live-code) A library for [mdx-deck](https://github.com/jxnblk/mdx-deck) to do live React and JS coding directly in slides.
181
205
-[react-router-ext](https://github.com/ri7nz/react-router-ext) An Extended [react-router-dom](https://github.com/ReactTraining/react-router/tree/master/packages/react-router-dom) with simple usage.
182
206
-[routex.js](https://github.com/alexhoma/routex.js) A dynamic routing library for Next.js.
207
+
-[hooked-form](https://github.com/JoviDeCroock/hooked-form) A lightweight form-management library for React.
208
+
-[goober](https://github.com/cristianbote/goober) Less than 1KB css-in-js alternative with a familiar API.
209
+
-[react-model](https://github.com/byte-fe/react-model) The next generation state management library for React
0 commit comments