Skip to content

Commit

Permalink
Add instructions on how to unminify main.js for easier browser debugg…
Browse files Browse the repository at this point in the history
…ing (mmistakes#3055)

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

* Fixed Markdown style like sggested by @iBug
  • Loading branch information
erikw authored Jul 23, 2021
1 parent 2c0044b commit 49ad911
Showing 1 changed file with 15 additions and 0 deletions.
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",
```

0 comments on commit 49ad911

Please sign in to comment.