Minify unbundled files with Terser
@DrewML is already working on this.
Since Aug 20, 2019.
- Dominant language
- JavaScript
- Stars
- 176
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
- [`terser`](https://github.com/terser-js/terser)
## Requirements
1. For each theme that is processed, all deployed `.js` files that are _not_ in `core-bundle.js` should be minified through terser
2. Minified files should be written in-place (same file name) to avoid the need for any path rewriting at build or runtime.
3. Minification should happen in worker threads, to speed up compilation time and avoid blocking the main thread's bundling work
## Pieces
- For worker-based minification, there's already the [`createMinifier`](https://github.com/magento/baler/blob/580079893561a89408e2602b48f484e062db3f80/src/createMinifier.ts) module that will create a pool of minification workers. We'll want to add a `minifyFromFile` API, though, so we don't need to read loose files into memory in the main process and then serialize/transfer/parse in the worker
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.