The theme’s [
assets/js/main.min.js] script is built from several vendor, jQuery plugins, and other scripts found in
minimal mistakes ├── assets | ├── js | | ├── plugins | | | ├── jquery.fitvids.js # fluid width video embeds | | | ├── jquery.greedy-navigation.js # priority plus navigation | | | ├── jquery.magnific-popup.js # responsive lightbox | | | └── jquery.smooth-scroll.min.js # make same-page links scroll smoothly | | ├── vendor | | | └── jquery | | | └── jquery-1.12.1.min.js | | ├── _main.js # jQuery plugin settings and other scripts | | └── main.min.js # concatenated and minified scripts
To modify or add your own scripts include them in
assets/js/_main.js and then rebuild using
npm run build:js. See below for more details.
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. Same goes for scripts that you remove.
In an effort to reduce dependencies a set of npm scripts are used to build
main.min.js instead of task runners like Gulp or Grunt. If those tools are more your style then by all means use them instead .
To get started:
- Install Node.js.
cdto the root of your project.
- Install all of the dependencies by running
Note: If you upgraded from a previous version of the theme be sure you copied over
package.json prior to running
If all goes well, running
npm run build:js will compress/concatenate
_main.js and all plugin scripts into