Skip to content

Commit

Permalink
docs: Create HELPERS.md
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell committed Feb 18, 2019
1 parent 9c465ab commit d1d3c8a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
57 changes: 57 additions & 0 deletions HELPERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## [babel-plugin-remove-ungap]

Remove the [@ungap ponyfill modules] from your bundle. This will decrease the size of
your bundle if you are targeting modern browsers only or if your build already includes
other polyfills. This has been tested with [hyperHTML] and [lighterhtml] bundles.


## [babel-plugin-template-html-minifier]

Run [html-minifier] on hyperHTML templates.


## [babel-plugin-bare-import-rewrite]

This can be used as an alternative to [rollup-plugin-node-resolve], or can be used with certain node.js
web servers to allow browsing live from source.

Known web server integrations:
* [fastify-babel] plugin for [fastify] enables running any babel plugins, generally expects `payload.filename` as set by [fastify-static]
* [express-transform-bare-module-specifiers] for [express] servers


## [vinyl-rollup]

This module copies the output of rollup builds to a stream of vinyl-fs objects for [gulp].
In addition it optionally adds files from modules that were bundled into the stream. This
makes it easy to ensure that LICENSE and package.json files associated with bundled modules
are published on the web server without publishing node.js server-side dependencies to the web.
This can also be used to copy complete modules if required for licensing or if bundled code
requires additional assets that are not part of the bundled JS (images for example).


## [babel-plugin-bundled-import-meta]

If `node_modules/some-web-component/index.js` uses `import.meta.url` to calculate the actual
path to `node_modules/some-web-components/image.png`, rollup does not compensate. This babel
plugin rewrites references to `import.meta.url` so it points to the original location where
it is expected that the additional assets (images and such) can be found. This plugin works
well with `vinyl-rollup` with `copyModules: true`.


[babel-plugin-remove-ungap]: https://github.com/cfware/babel-plugin-remove-ungap#readme
[@ungap ponyfill modules]: https://github.com/ungap/ungap.github.io#readme
[hyperHTML]: https://github.com/WebReflection/hyperHTML#readme
[lighterhtml]: https://github.com/WebReflection/lighterhtml#readme
[babel-plugin-template-html-minifier]: https://github.com/cfware/babel-plugin-template-html-minifier#readme
[html-minifier]: https://github.com/kangax/html-minifier#readme
[babel-plugin-bare-import-rewrite]: https://github.com/cfware/babel-plugin-bare-import-rewrite#readme
[rollup-plugin-node-resolve]: https://github.com/rollup/rollup-plugin-node-resolve#readme
[fastify]: https://github.com/fastify/fastify#readme
[fastify-babel]: https://github.com/cfware/fastify-babel#readme
[fastify-static]: https://github.com/fastify/fastify-static#readme
[express-transform-bare-module-specifiers]: https://github.com/nodecg/express-transform-bare-module-specifiers#readme
[express]: https://github.com/expressjs/express#readme
[vinyl-rollup]: https://github.com/cfware/vinyl-rollup#readme
[gulp]: https://github.com/gulpjs/gulp#readme
[babel-plugin-bundled-import-meta]: https://github.com/cfware/babel-plugin-bundled-import-meta#readme
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ You can require or import _hyperHTML_ with any bundler and in different ways.

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).

See [HELPERS.md] for a list of additional tools which can be helpful for building hyperHTML based web applications.

- - -

## Sponsors
Expand Down

0 comments on commit d1d3c8a

Please sign in to comment.