Adding vendor JS to manifest.json not working

I added a vendor plugin to manifest.json but it keeps giving me an error.

Here’s my manifest.json file:

{
  "dependencies": {
    "main.js": {
      "files": [
        "scripts/main.js"
      ],
      "vendor": [
        "scripts/vendor/paperfold.js" //This is my vendor plugin
      ],
      "main": true
    },
    "main.css": {
      "files": [
        "styles/main.scss"
      ],
      "main": true
    },
    "customizer.js": {
      "files": [
        "scripts/customizer.js"
      ]
    },
    "jquery.js": {
      "bower": [
        "jquery"
      ]
    }
  },
  "config": {
    "devUrl": "http://yaharga/"
  }
}

It gives me the following error:

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error
    at new JS_Parse_Error (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1526:18)
    at js_error (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1534:11)
    at croak (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2026:9)
    at token_error (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2034:9)
    at unexpected (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2040:9)
    at expr_atom (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2554:9)
    at maybe_unary (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2716:19)
    at expr_ops (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2751:24)
    at maybe_conditional (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2756:20)
    at maybe_assign (eval at <anonymous> (/Applications/MAMP/htdocs/yaharga/web/app/themes/yolk/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2780:20)

Check your js files everyone! Apparently I downloaded the html page instead of the js file from the github repo.

On that note, how would I install this vendor js using bower instead of manually downloading it and adding it to the folder and then manifest.json? It has no package registered on bower. Is what I did best practice, or is there a better way?

I got the package from here: https://github.com/mrflix/paperfold

Thanks!

Not “registered on bower?” https://github.com/mrflix/paperfold/blob/master/bower.json

See also:

  1. http://bower.io/#install-packages
  2. https://roots.io/sage/docs/theme-development-and-building/#adding-front-end-packages-with-bower

I tried searching for it on http://bower.io/search/ but couldn’t find it using the keywords “paper” and “fold”. How would I be able to install it after I find the bower file in the repository? Thanks.

Please read the documentation for Bower and Sage. The links I posted above will take you directly to the relevant docs.

I appreciate you replying to me once again. Perhaps you misunderstood me.

I tried installing it using bower install --save paperfold and
bower install --save https://github.com/mrflix/paperfold/blob/master/bower.json but it doesn’t work. Even bower install --save https://github.com/mrflix/paperfold.git won’t work. I purchased the Roots book and the Gulp and Bower screencast. What am I doing wrong?

What am I doing wrong?

You’re not reading the Bower docs I linked to above :wink:

1 Like

I kept going back to the second one. Sorry. Thanks! Appreciate your patience.