hontas / gulp-task-loader Goto Github PK
View Code? Open in Web Editor NEWOrganize your gulp-tasks in separate files
Home Page: https://www.npmjs.com/package/gulp-task-loader
Organize your gulp-tasks in separate files
Home Page: https://www.npmjs.com/package/gulp-task-loader
We've been using gulp-task-loader for our project since 1.3.1 and we have the following folder setup.
src/
gulp/
tasks/
build/
fonts.js
images.js
sass.js
templates.js
test/
e2e.js
lint.js
unit.js
We have gulp-task-loader configured to look for tasks in src/gulp/tasks/
require ('gulp-task-loader')({dir: './src/gulp/tasks');
After updating to 1.4.0, we started receiving the following error:
Error: Cannot find module '/home/portiz/repos/project/src/gulp/tasks/fonts.js'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at loadTask (/home/portiz/repos/project/node_modules/gulp-task-loader/index.js:41:14)
at loadTasks (/home/portiz/repos/project/node_modules/gulp-task-loader/index.js:66:4)
at /home/portiz/repos/project/node_modules/gulp-task-loader/index.js:71:6
at Array.forEach (native)
at loadTasks (/home/portiz/repos/project/node_modules/gulp-task-loader/index.js:70:6)
at /home/portiz/repos/project/node_modules/gulp-task-loader/index.js:71:6
Stepping through and debugging our gulp tasks, we found that the gulp-task-loader was truncating the "build" path node from the task location. It occurs somewhere on line 66:
loadTask(currentPath.split('/').slice(opts.dir.split('/').length, -1), file);
Is there something wrong with gulp-task-loader, or are we doing something wrong with the new version on our end?
I'm trying to point my task loader to a specific folder ./tasks/dev
gulp.task("default", function(){ require('gulp-task-loader')( { dir: './tasks/dev/', settings: settings, handleErrors: handleErrors }); });
But when I run the task it actually doubles the 'dev' part of the folder path.
[10:14:37] Error: Cannot find module 'C:\Git\my-project\tasks**\dev\dev**browser-sync.js'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at loadTask (C:\Git\my-project\node_modules\gulp-task-loader\index.js:50:14)
at loadTasks (C:\Git\my-project\node_modules\gulp-task-loader\index.js:71:4)
at C:\Git\my-project\node_modules\gulp-task-loader\index.js:76:6
at Array.forEach (native)
at loadTasks (C:\Git\my-project\node_modules\gulp-task-loader\index.js:75:6)
at module.exports (C:\Git\my-project\node_modules\gulp-task-loader\index.js:81:2)
This actually look very similar to #12 and devbridge/Front-End-Toolkit#56
I'm running version 1.4.2
It would vbe great to add coffee support
Hi!
I have a problem with serving the tasks from directory that is not placed in the root of application(i.e. gulp/tasks). Basically the problem is that the tasks are not loading properly because the path to the module is not being created correctly. For example with above dir
I get Cannot resolve module ... \gulp\tasks\tasks\build\hello.js
. I created a fix for this altrough maybe it is not neccesary and it is just a problem for me. But you can take a look at it and eventually merge it if you'd like. I wrote the tests too, everything's passing.
For example if you provide path 'gulp-task/tasks' it will fail on windows as it uses different paths. Maybe there should be recommendation to pass paths using path library? . As you are using it internally in your code.
After updating from 1.0.8, the module is looking for the tasks relatively to its installation folder.
This doesn't work:
taskLoader(path.join(__dirname, 'tasks'));
Stack trace:
Error: Cannot find module '/home/myuser/myfolder/myapp/node_modules/gulp-task-loader/home/myuser/myfolder/myapp/tasks/angularTemplates.js
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at loadTask (/home/myuser/myfolder/myapp/node_modules/gulp-task-loader/index.js:44:14)
at loadTasks (/home/myuser/myfolder/myapp/node_modules/gulp-task-loader/index.js:65:4)
at Array.forEach (native)
at module.exports (/home/myuser/myfolder/myapp/node_modules/gulp-task-loader/index.js:77:4)
at Object.<anonymous> (/home/myuser/myfolder/myapp/gulpfile.js:20:1)
I'm trying to ingest tasks from a parent directory. Is this not possible?
require('gulp-task-loader')('../config/gulp/tasks');
In gulp tasks defined in gulpfile.js it is possible to define dependent tasks to specify that one task must complete before another begins (see the final example here https://github.com/gulpjs/gulp/blob/master/docs/API.md#async-task-support).
Is this somehow supported for tasks created in the gulp-tasks folder?
Does not work with gulp v4.0.0 ?
I'm working on something over vpn/samba, and my mac is creating these http://apple.stackexchange.com/a/14981/87168 which then gulp-task-loader is trying to load and obviously fails with SyntaxError: Unexpected token ILLEGAL
DIt would be nice if you could define some sort of filter in options.
Can we have glob support to make filtering better? Filtering by extension won't work for me as i have some .spec.js files. would like to be able to:
require('gulp-task-loader')('tasks/gulp/!(*.spec).js');
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.