shlomiassaf / ng-cli-packagr-tasks

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

Problem resolving paths on windows #7

Closed lucasgranberg closed 5 years ago

lucasgranberg commented 5 years ago

On windows the root path coming from the EntryPointTaskContext contains the drive letter on windows. That in combination with path.resolve yields a path looking like this: C:/c/project/asd.txt (note the double drive letter). This leads to none of the glob patterns matching. I can build my project just fine on linux.

https://github.com/shlomiassaf/ng-cli-packagr-tasks/blob/d75109337a35faf7bb110e61a25489fadcf448ae/src/tasks/copy-file.ts#L27

https://github.com/shlomiassaf/ng-cli-packagr-tasks/blob/d75109337a35faf7bb110e61a25489fadcf448ae/src/tasks/copy-file.ts#L80

lucasgranberg commented 5 years ago

I think the problem stems from using normalize() from @angular-devkit/core together with Path.resolve(). My quick & dirty solution was to create my own task and use replace(/^([a-z]):\/\1/gi,'$1:') to "fix" the problem. https://gist.github.com/lucasgranberg/1adf3f4e2e5b696e5e8de6b6ad890d82