Skip to content

Commit 6995cd6

Browse files
committed
Update /docs/javascript/ to reflect changes in 0b8b523
Closes #5326
1 parent ec1aeb7 commit 6995cd6

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

docs/_docs/17-javascript.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ minimal mistakes
2727

2828
## Customizing
2929

30-
To modify or add your own scripts include them in [`assets/js/_main.js`](https://github.com/mmistakes/minimal-mistakes/blob/master/assets/js/_main.js) and then rebuild using `npm run build:js`. See below for more details.
30+
To modify or add your own scripts include them in [`assets/js/_main.js`](https://github.com/mmistakes/minimal-mistakes/blob/master/assets/js/_main.js) and then rebuild using `bundle exec rake js`. See below for more details.
3131

3232
If you add additional scripts to `assets/js/plugins/` and would like them concatenated with the others, be sure to update the `uglify` script in [`package.json`](https://github.com/mmistakes/minimal-mistakes/blob/master/package.json). Same goes for scripts that you remove.
3333

@@ -52,7 +52,7 @@ after_footer_scripts:
5252

5353
## Build process
5454

55-
In an effort to reduce dependencies a set of [**npm scripts**](https://css-tricks.com/why-npm-scripts/) are used to build `main.min.js` instead of task runners like [Gulp](http://gulpjs.com/) or [Grunt](http://gruntjs.com/). If those tools are more your style then by all means use them instead :wink:.
55+
In an effort to reduce dependencies a set of [**Rake** rules](https://github.com/ruby/rake) are used to build `main.min.js` instead of task runners like [Gulp](http://gulpjs.com/) or [Grunt](http://gruntjs.com/). If those tools are more your style then by all means use them instead :wink:.
5656

5757
To get started:
5858

@@ -63,20 +63,16 @@ To get started:
6363
**Note:** If you upgraded from a previous version of the theme be sure you copied over [`package.json`](https://github.com/{{ site.repository }}/blob/master/package.json) prior to running `npm install`.
6464
{: .notice--warning}
6565

66-
If all goes well, running `npm run build:js` will compress/concatenate `_main.js` and all plugin scripts into `main.min.js`.
66+
If all goes well, running `bundle exec rake js` will compress/concatenate `_main.js` and all plugin scripts into `main.min.js`.
6767

6868
## Debugging
6969

70-
The minified JavaScript is harder to debug in the browser than the raw source. To stop the minification and bundle all the JavaScript as-is --- open up `package.json` and edit the value `scripts.uglify` from:
70+
The minified JavaScript is harder to debug in the browser than the raw source. To stop the minification and bundle all the JavaScript as-is --- open up `Rakefile` and edit the block of `file JS_TARGET` like this:
7171

72-
```json
73-
"scripts": {
74-
"uglify": "uglifyjs [...] -c -m -o assets/js/main.min.js",
75-
```
76-
77-
To the following:
78-
79-
```json
80-
"scripts": {
81-
"uglify": "cat [...] > assets/js/main.min.js",
72+
```diff
73+
file JS_TARGET => ["_includes/copyright.js"] + JS_FILES do |t|
74+
- sh Shellwords.join(%w[npx uglifyjs -c --comments /@mmistakes/ --source-map -m -o] +
75+
+ sh Shellwords.join(%w[cat >] +
76+
[t.name] + t.prerequisites)
77+
end
8278
```

0 commit comments

Comments
 (0)