Open iamrakesh opened 8 years ago
everything is already described in faq section, try more and you'll success. Alternatively you can try ts-node to run gulp tasks without this compilation hack in .js
Hi @iamrakesh,
I also had issues loading my gulpfiles from different files. I had some settings in my tscofnig.json and did not want to load this when evaling the scripts, as I did not want to have more dependencies. I think the problem was that my tsconfig did resolve the require differently.
I simply fixed this by creating a static init method on the loaded gulpclass:
gulpfile.ts:
import { Deploy } from "./deployment";
...
Deploy.init();
deployment.ts:
@Gulpclass()
export class Deploy {
@SequenceTask()
deploy() { ... }
...
static init() {
console.log("Initialized Deyployment");
}
}
This init call forces to load the module and, thus, create the missing tasks on the Deploy class.
@pleerock: Maybe you could add this als alternative route.
Hi, FAQ section of readme, explains about what needs to be in gulpfile.js, but I couldn't make it work, I've trouble with how to add tasks in other .ts files.
The way I tried is to have a class 'MyTasks' with tasks in one.ts, in gulpfile.ts have Gulpfile class extend MyTasks. But this doesn't seems to work.
Could please provide a full example on how to do this ?
Thanks, Rakesh.A