From 83ffafc1a0b049563f29f0c44df244737ac52595 Mon Sep 17 00:00:00 2001 From: Erik Westrup Date: Sun, 11 Jul 2021 15:17:50 +0200 Subject: [PATCH 1/2] Add instructions on how to unminify main.js for easier browser debugging --- docs/_docs/17-javascript.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/_docs/17-javascript.md b/docs/_docs/17-javascript.md index 072fc3f92cc2..cf930ef98229 100644 --- a/docs/_docs/17-javascript.md +++ b/docs/_docs/17-javascript.md @@ -64,3 +64,15 @@ 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", +``` From e0bd842527bc5d4a89eddf609a2a21318f0e24a1 Mon Sep 17 00:00:00 2001 From: Erik Westrup Date: Mon, 12 Jul 2021 16:53:54 +0200 Subject: [PATCH 2/2] Fixed Markdown style like sggested by @iBug --- docs/_docs/17-javascript.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_docs/17-javascript.md b/docs/_docs/17-javascript.md index cf930ef98229..689fd90a2f81 100644 --- a/docs/_docs/17-javascript.md +++ b/docs/_docs/17-javascript.md @@ -67,11 +67,14 @@ If all goes well, running `npm run build:js` will compress/concatenate `_main.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",