shlomiassaf / ng-cli-packagr-tasks

Tasks & Workflow for ng-packagr.
MIT License
31 stars 6 forks source link

Doesn't work on Windows #1

Closed ybeauchamph closed 5 years ago

ybeauchamph commented 5 years ago

Thanks you for creating this! I'm having some issue with it though.

My transformConfig file is not loaded because of the normalized path of the dev kit. On Windows, the drive letter are normalized to /C/rest of path. This cause the getTransformerHooks to resolve with an empty promise because FS.existsSync(tPath) return false. If I use the devKitCore.getSystemPath() function for the tPath, it seems to fix that issue for me. I'm not sure about other OS when using this function.

I can create a pull request if you'd prefer. Here is the change:

private getTransformerHooks(transformerPath: string): Promise<NgPackagerTransformerHooks> {
    const root = this.context.workspace.root;
    const tPath = devKitCore.getSystemPath(devKitCore.resolve(root, devKitCore.normalize(transformerPath)));
    if (FS.existsSync(tPath)) {
        ...
shlomiassaf commented 5 years ago

Hi, thanks!

I fixed it, however, there's a new version (2.0.x) with breaking changes...

basically with improved hook control and types tasks so I can provide input to the tasks through angular.json and validate it...

The validation is actually dynamic.