Skip to content

Commit

Permalink
Merge pull request #138 from arichiardi/build-from-source
Browse files Browse the repository at this point in the history
Use node-zopfli and build locally instructions
  • Loading branch information
jscheid authored Sep 24, 2024
2 parents dd7645a + 982dd9a commit 6892098
Show file tree
Hide file tree
Showing 4 changed files with 285 additions and 604 deletions.
15 changes: 12 additions & 3 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ the included [Vagrant](https://www.vagrantup.com/) box. Install Vagrant, then
run `vagrant up --provider=virtualbox` in this directory to initialize the
environment. Run the below commands prefixed by `./with-vagrant`.

If you would rather not use Vagrant, you can derive instructions for how to set
up your local build environment from `Vagrantfile`; if you do so, please
consider sending a PR with instructions.
### Building locally

Building locally is not tested thoroughly and Vagrant is the recommended
way. However, requirements are provided below.

#### Requirements

:warning: As the JS tooling evolves the documentation below might get outdated :warning:

* [node-zopfli requirements](https://github.com/pierreinglebert/node-zopfli?tab=readme-ov-file#prerequisites-for-building)
and specifically a working [node-gyp](https://github.com/nodejs/node-gyp#installation) installation.
* `pandoc` and matching [panflute version](https://github.com/sergiocorreia/panflute?tab=readme-ov-file#note-on-versions).

## Building

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dist/bootstrap-min.js: bootstrap.js externs.js
--language_out=ECMASCRIPT_2017

dist/prettier-el.js.gz.base64: build/prettier-el-min.js
node -e "const fs = require('fs'); const zopfli = require('node-zopfli-es'); fs.createReadStream('$<').pipe(zopfli.createGzip()).pipe(process.stdout)" \
node -e "const fs = require('fs'); const zopfli = require('node-zopfli'); fs.createReadStream('$<').pipe(zopfli.createGzip()).pipe(process.stdout)" \
| base64 --wrap=70 > $@

dist/prettier-pkg.el: prettier.el build-tools/create-pkg-el.el
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"google-closure-compiler": "20220405.0.0",
"node-zopfli-es": "1.0.7"
"node-zopfli": "2.1.4"
},
"prettier": {
"trailingComma": "es5"
Expand Down
Loading

0 comments on commit 6892098

Please sign in to comment.