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
* Document @ for the --define option
I had to dig through the code in order to figure out how to replace an expression.
I was initially trying to do `microbundle --define global=window` which should actually be `microbundle --define @global=window`
* Add --define section to readme
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,6 +220,16 @@ To achieve the smallest possible bundle size, libraries often wish to rename int
220
220
221
221
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).**
222
222
223
+
### Defining build-time constants
224
+
225
+
The `--define` option can be used to inject or replace build-time constants when bundling. In addition to injecting string or number constants, prefixing the define name with `@` allows injecting JavaScript expressions.
0 commit comments