ahmadawais / WPGulp

An advanced Gulp workflow for WordPress development with extensive documentation. Used by 40,000+ themes and plugins.
https://twitter.com/MrAhmadAwais/
MIT License
1.77k stars 303 forks source link

Adding js files to vendor folder like on the wpgulp V1 doesnt seem to work #117

Closed robmim closed 5 years ago

robmim commented 6 years ago

In version 01 of WPGULP :

I simply drop a js file into the vendor folder and it will be concatenated into a single JS file name vendor.js using the command : GULP

But in version 02, using GULP or NPM START doesnt seem to work. Always get the error:

Uncaught TypeError: Cannot set property 'js-filename-in-vendor-folder' of undefined

GULP, NODE and NPM version https://www.dropbox.com/s/hv26fhwks4nky0m/Capture%20d%27%C3%A9cran%202018-09-21%2017.18.03.png?dl=0

Console errors https://www.dropbox.com/s/x8nc4upf51fc3ot/Capture%20d%27%C3%A9cran%202018-09-21%2016.56.28.png?dl=0

functions.php https://www.dropbox.com/s/wygmqimj441rc6z/Capture%20d%27%C3%A9cran%202018-09-21%2016.57.39.png?dl=0

wpgulp.config.js https://www.dropbox.com/s/kt5yxvlo69xo0o5/Capture%20d%27%C3%A9cran%202018-09-21%2017.07.24.png?dl=0

I tried with the version 01 setup and its worinking fine but in version 02, nothings work.

What am i doing wrong ????

robmim commented 6 years ago

Do not have others choice then to rollback to version 01 with babel implementation until i get this fix.

ahmadawais commented 6 years ago

That console log error shows that one of the vendor scripts you are using is causing a problem and with that I can't help. For my tests the vendors file worked just fine. You should be enqueueing the .min.js files for both vendor and custom.

robmim commented 6 years ago

The vendors files i'm using are :

Barba.js https://github.com/luruke/barba.js

Hunt.js https://github.com/jeremenichelli/hunt

ahmadawais commented 6 years ago

Can you point me to a sample directory where I can test WPGulp with your vendor scripts?

bilalmalkoc commented 5 years ago

I have same problem. When i concatenate with true order (ie. jquery -> popper -> bootstrap) vendor.js shows console error.

ahmadawais commented 5 years ago

I am open to a PR that fixes this issue. Unable to find more time this week.

bilalmalkoc commented 5 years ago

Is that fixed? I can't see in PR.

robmim commented 5 years ago

Hi @ahmadawais,

There an article that explain the issue here

https://stackoverflow.com/questions/51307582/barba-is-not-defined-error

mykt0ngc0 commented 5 years ago

It appears that some vendor files don't go well with gulp-babel.

Commenting out the babel pipeline on vendorsJS task does the trick for me. 👇

untitled

Source: prncdahal on issue #136

robmim commented 5 years ago

@mykt0ngc0 indeed this work great. Thanks !!!

kleytoncaires commented 4 years ago

It appears that some vendor files don't go well with gulp-babel.

Commenting out the babel pipeline on vendorsJS task does the trick for me. 👇

untitled

Source: prncdahal on issue #136

doesnt work for me