Closed Zardoz89 closed 4 years ago
Actually, I don't think people should be using the gulp mojo - a much better alternative is to use the npx
mojo/goal, to run gulp. That way, it will work with this Maven plugin in the future, even if gulp breaks in some other way. The same applies to grunt and webpack as well.
I think that it's a good idea, but should be done on another issue/pull request (as need more changes and proper testing). This could be merged as is it now (and I need ASAP, so I could rewrite my gulpfiles to use ES6 import/export)
What I mean is, you can do it today with this version of frontend-maven-plugin (it's already supported), you just configure it differently!
Instead of this:
<execution>
<id>gulp build</id>
<goals>
<goal>gulp</goal>
</goals>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
you can do this:
<execution>
<id>gulp build</id>
<goals>
<goal>npx</goal>
</goals>
<configuration>
<arguments>gulp build</arguments>
</configuration>
</execution>
Oh! Sorry I didn't understand you the first time. I did a little test, and works fine for my case.
Summary
Resolves issue #913 . First try to use gulp-cli if it's found on node-modules. If it not exists, then fallbacks to the old behaviour where calls to "node-modules/gulp/bin/gulp.js" that calls the embed gulp-cli of gulp.js
Tests and Documentation
Given this two files :
gulpfile.js
package.js
It must run correctly and copy any js file from input to output.