shlomiassaf / ng-cli-packagr-tasks

Tasks & Workflow for ng-packagr.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem resolving paths on windows

lucasgranberg opened this issue · comments

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.

const { builderContext, options, root } = globalContext;

asset.input = Path.resolve(root, asset.input).replace(/\\/g, '/');

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