Basically, the build task just says here are a bunch of subtasks that, when we call the build tasks, it just runs all of these other tasks. The build task by default has three dependency tasks: 'html', 'fonts', and 'other'. These tasks do things like generate the minified and concatenated project files over to your dist/ folder. What I'm going to do is add another task to the dependencies of the build task, I'll call this one 'no-min-copy'. Then it will look in my directory for app/no-min-copy, and it will straight up copy those files (no mininification or anything) over to a 'no-min-copy' directory inside of the dist directory. Then we can keep the relative paths in our third party code and shouldn't have problems.
It's not very difficult to add a new task in gulp once you understand how it works, but it can take a very long time to understand how it works. When we run gulp in the Gulp-Angular generated project it runs the gulp build task. Even at work, I normally scaffold new AngularJs projects with the Gulp-Angular yeoman generator. In the gulp folder of the scaffolding project is a file called build.js.
Then I'll add the no-min-copy task to the dependencies for the build task (note that in gulp 3 all the dependencies run in parallel so it doesn't matter what order you list the dependency tasks):
The posts on this site are written and maintained by Jim Lynch. About Jim...
Want FREE access to
my daily stock tips
"The Triple Gainers"?
Sign up here!