Skip to content

Commit d1d3c8a

Browse files
committed
docs: Create HELPERS.md
Fixes #343
1 parent 9c465ab commit d1d3c8a

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

HELPERS.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## [babel-plugin-remove-ungap]
2+
3+
Remove the [@ungap ponyfill modules] from your bundle. This will decrease the size of
4+
your bundle if you are targeting modern browsers only or if your build already includes
5+
other polyfills. This has been tested with [hyperHTML] and [lighterhtml] bundles.
6+
7+
8+
## [babel-plugin-template-html-minifier]
9+
10+
Run [html-minifier] on hyperHTML templates.
11+
12+
13+
## [babel-plugin-bare-import-rewrite]
14+
15+
This can be used as an alternative to [rollup-plugin-node-resolve], or can be used with certain node.js
16+
web servers to allow browsing live from source.
17+
18+
Known web server integrations:
19+
* [fastify-babel] plugin for [fastify] enables running any babel plugins, generally expects `payload.filename` as set by [fastify-static]
20+
* [express-transform-bare-module-specifiers] for [express] servers
21+
22+
23+
## [vinyl-rollup]
24+
25+
This module copies the output of rollup builds to a stream of vinyl-fs objects for [gulp].
26+
In addition it optionally adds files from modules that were bundled into the stream. This
27+
makes it easy to ensure that LICENSE and package.json files associated with bundled modules
28+
are published on the web server without publishing node.js server-side dependencies to the web.
29+
This can also be used to copy complete modules if required for licensing or if bundled code
30+
requires additional assets that are not part of the bundled JS (images for example).
31+
32+
33+
## [babel-plugin-bundled-import-meta]
34+
35+
If `node_modules/some-web-component/index.js` uses `import.meta.url` to calculate the actual
36+
path to `node_modules/some-web-components/image.png`, rollup does not compensate. This babel
37+
plugin rewrites references to `import.meta.url` so it points to the original location where
38+
it is expected that the additional assets (images and such) can be found. This plugin works
39+
well with `vinyl-rollup` with `copyModules: true`.
40+
41+
42+
[babel-plugin-remove-ungap]: https://github.com/cfware/babel-plugin-remove-ungap#readme
43+
[@ungap ponyfill modules]: https://github.com/ungap/ungap.github.io#readme
44+
[hyperHTML]: https://github.com/WebReflection/hyperHTML#readme
45+
[lighterhtml]: https://github.com/WebReflection/lighterhtml#readme
46+
[babel-plugin-template-html-minifier]: https://github.com/cfware/babel-plugin-template-html-minifier#readme
47+
[html-minifier]: https://github.com/kangax/html-minifier#readme
48+
[babel-plugin-bare-import-rewrite]: https://github.com/cfware/babel-plugin-bare-import-rewrite#readme
49+
[rollup-plugin-node-resolve]: https://github.com/rollup/rollup-plugin-node-resolve#readme
50+
[fastify]: https://github.com/fastify/fastify#readme
51+
[fastify-babel]: https://github.com/cfware/fastify-babel#readme
52+
[fastify-static]: https://github.com/fastify/fastify-static#readme
53+
[express-transform-bare-module-specifiers]: https://github.com/nodecg/express-transform-bare-module-specifiers#readme
54+
[express]: https://github.com/expressjs/express#readme
55+
[vinyl-rollup]: https://github.com/cfware/vinyl-rollup#readme
56+
[gulp]: https://github.com/gulpjs/gulp#readme
57+
[babel-plugin-bundled-import-meta]: https://github.com/cfware/babel-plugin-bundled-import-meta#readme

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ You can require or import _hyperHTML_ with any bundler and in different ways.
4141

4242
If requiring or importing from `"hyperhtml"` doesn't work, try requiring from `"hyperhtml/cjs"` for CommonJS friendly bundlers (WebPack), or `"hyperhtml/esm"` for ESM compatible bundlers (Rollup).
4343

44+
See [HELPERS.md] for a list of additional tools which can be helpful for building hyperHTML based web applications.
45+
4446
- - -
4547

4648
## Sponsors

0 commit comments

Comments
 (0)