Repository: ng-packagr/ng-packagr

Issue #21: Support sass import files
Created: 2017-06-02T06:16:30Z
Hello, in my library I have sass files and I can not compile with ng-package since it does not seem to support them when you have imports from other sass files:
My error:
 formatted: Error: File to import not found or unreadable: ../../../node_modules/@stratio/egeo-ui-base/utils/typography.
       Parent style sheet: /home/pjpena/Documentos/projects/egeo/egeo/src/lib/st-radio-menu/st-radio-menu.component.scss
        on line 1 of src/lib/st-radio-menu/st-radio-menu.component.scss
>> @import '../../../node_modules/@stratio/egeo-ui-base/utils/typography';

Duplicate issue #51: gulp-inline-ng2-template: Error with @angular/animations
Created: 2017-06-08T11:13:35Z
Because of lack of publishing lib with Angular CLI, I started to use your plugin which packages our Angular app into NPM package  that can be published. Our whole Angular application is both library and application that can be built to be hosted. My goal here is to package the application so that others applications can use our reusable components. There is the ng-package.json :
{
  "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
  "src": "",
  "dest": "dist",
  "workingDirectory": ".ng_build",
  "lib": {
    "entryFile": "src/public_api.ts"
  }
}
The public_api.ts only export the main module that will be imported in the other application.
export * from './app/main.module';
And this is our package.json file
"scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build:lib": "ng-packagr",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
"dependencies": {
    "@angular/animations": "^4.1.3",
    "@angular/common": "^4.1.3",
    "@angular/compiler": "^4.1.3",
    "@angular/core": "^4.1.3",
    "@angular/forms": "^4.1.3",
    "@angular/http": "^4.1.3",
    "@angular/platform-browser": "^4.1.3",
    "@angular/platform-browser-dynamic": "^4.1.3",
    "@angular/router": "^4.1.3",
...
}
When I launch npm run build:lib, I face into this error
Building Angular library from C:\_Git\SFK\src\Sfk.WebComponents\ng-package.json
fs.js:583
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open 'C:\_Git\SFK\src\Sfk.WebComponents\node_modules\@angular\animations\src\my-component-tpl.html'
    at Object.fs.openSync (fs.js:583:18)
    at Object.fs.readFileSync (fs.js:490:33)
    at getFileData (C:\_Git\SFK\src\Sfk.WebComponents\node_modules\gulp-inline-ng2-template\parser.js:284:17)
    at C:\_Git\SFK\src\Sfk.WebComponents\node_modules\gulp-inline-ng2-template\parser.js:248:22
    at C:\_Git\SFK\src\Sfk.WebComponents\node_modules\async\dist\async.js:3830:24
    at replenish (C:\_Git\SFK\src\Sfk.WebComponents\node_modules\async\dist\async.js:946:17)
    at C:\_Git\SFK\src\Sfk.WebComponents\node_modules\async\dist\async.js:950:9
    at eachOfLimit (C:\_Git\SFK\src\Sfk.WebComponents\node_modules\async\dist\async.js:975:24)
    at C:\_Git\SFK\src\Sfk.WebComponents\node_modules\async\dist\async.js:980:16
    at _parallel (C:\_Git\SFK\src\Sfk.WebComponents\node_modules\async\dist\async.js:3829:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sfk@1.0.0 build:lib: `ng-packagr`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sfk@1.0.0 build:lib script 'ng-packagr'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sfk package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng-packagr
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sfk
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sfk
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\cgigax\AppData\Roaming\npm-cache\_logs\2017-06-08T11_01_23_336Z-debug.log

The log say something like this
13 info lifecycle sfk@1.0.0~build:lib: Failed to exec build:lib script
14 verbose stack Error: sfk@1.0.0 build:lib: `ng-packagr`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\cgigax\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:194:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\cgigax\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:194:7)
14 verbose stack     at maybeClose (internal/child_process.js:899:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Any ideas ?

Closing comment (2017-06-08T15:25:02Z): The issue here seems also to be that your build picks up .d.ts files from node_modules. To what is the src directory from ng-package.json configured?
|- package.json
|- node_modules
    |- @angular
        |- animations
            |- animations.d.ts
|- ng-package.json    # <-- does "src" point to the root folder?
|- my-lib             # <-- can you set it to here?
    |- public_api.ts

Is this a duplicate of #21?