Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions on how to unminify main.js for easier browser debugging #3055

Merged
merged 2 commits into from
Jul 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/_docs/17-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,18 @@ To get started:
{: .notice--warning}

If all goes well, running `npm run build:js` will compress/concatenate `_main.js` and all plugin scripts into `main.min.js`.

## Debugging
The minified Javascript is harder to debug in the browser than the raw source. To stop the minification and just bundle all the Javascript as-is; open up `package.json` and edit the value `scripts.uglify` from:

```json
"scripts": {
"uglify": "uglifyjs [...] -c -m -o assets/js/main.min.js",
```

to simply concatenating the files:

```json
"scripts": {
"uglify": "cat [...] > assets/js/main.min.js",
```