Package Exports
- micromark-build
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (micromark-build) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
micromark-build
A small CLI to build micromark development source code (for this monorepo but also for extensions and integrations) into production code.
If you are making a micromark extension or are otherwise integrating with its code, you should use this.
State machines are hard: assertions, debugging messages, and readable names are great to develop with, but slow or big in production, this solves that.
Install
npm:
npm install micromark-build --save-dev
Use
Say we have this folder (called my-micromark-extension
):
dev/lib/core.js
dev/lib/util.js
dev/index.js
And we add micromark-build
in a build
script in package.json
:
"scripts": {
"build": "micromark-build"
},
Now, running that with npm run build
, we’d get:
dev/lib/core.js
dev/lib/util.js
dev/index.js
+lib/core.js
+lib/util.js
+index.js
To expose the production code by default, and the dev/
files on a condition,
use an export map in package.json
:
"exports": {
"development": "./dev/index.js",
"default": "./index.js"
},
Users can then use node --conditions development
to use the dev files.
CLI
There is no interface and there are no options. See Use above: run it and get files out.
The following Babel plugins are used:
babel-plugin-unassert
— Removeassert
callsbabel-plugin-undebug
— Removedebug
callsbabel-plugin-undebug
— Inline the values frommicromark-util-symbol
You should use assert
, debug
, and micromark-util-symbol
to develop
micromark extensions!
Security
See security.md
in micromark/.github
for how to
submit a security report.
Contribute
See contributing.md
in micromark/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.