Adding plugin js to the asset pipeline doesn't load. Please help

Hello,

I’m trying to add some plugin js to the asset pipeline as per the video. I’ve dequeued the plugin js ok, but when I add the vendor js to main js the scripts aren’t included when I run gulp.

The below id my code block. Am I missing a step?

Thanks, Stephen

"main.js": {
      "files": [
        "scripts/main.js"
      ],
      "vendor": [
        "../../plugins/wp-typography/js/jquery.selection.js",
        "../../plugins/wp-typography/js/clean_clipboard.js"
      ],
      "main": true
    },

The config you provided looks like it should work as expected

I’ve personally ran into some weird issues with asset-builder on newer versions of Node.js and have had to revert to Node 4.5.0 on a couple projects to get it to continue working as expected

What version of Node.js are you on right now? If on a newer version, can you try using nvm to switch to 4.5.0 and seeing if that works? Not the best solution, but worth a shot.

Thanks Ben, I’m using NVM & Node 4.2.2

Just spun up a Sage 8 install with that plugin and was able to get the theme to pull in the JS as expected.

If you open up the generated scripts.js file in Sage, you should be able to see parts of those two files within it. Since it’s minified JS, you won’t be able to search for exact strings but it should be all there.

My full manifest.json file from Sage 8.5.0 with the typography plugin JS included:

{
  "dependencies": {
    "main.js": {
      "files": [
        "scripts/main.js"
      ],
      "vendor": [
        "../../plugins/wp-typography/js/jquery.selection.js",
        "../../plugins/wp-typography/js/clean_clipboard.js"
      ],
      "main": true
    },
    "main.css": {
      "files": [
        "styles/main.scss"
      ],
      "main": true
    },
    "customizer.js": {
      "files": [
        "scripts/customizer.js"
      ]
    },
    "jquery.js": {
      "bower": ["jquery"]
    }
  },
  "config": {
    "devUrl": "http://example.dev"
  }
}

Thanks Ben, will give it a shot :slight_smile: