#separate entry points with ng-packagr

7 messages · Page 1 of 1 (latest)

wispy agate
#

How do I do this? I've different folders under my app/src folder and I'd like to have separate entry points for each.. right now it compiles one huge bundle file and I can't import individually

fickle tartan
wispy agate
#

thx this helps a bit, I'm struggling with imports from different folder

src/app
  |models
  |services

and importing a model from services results in:

import { CustomHttpParams } from '../../models';

src/app/services/http/bank.service.ts:8:34 - error TS6059: File 'D:/Workspaces/frontend//src/app/models/index.ts' is not under 'rootDir' 'D:\Workspaces\frontend\i\src\app\services'. 'rootDir' is expected to contain all source files.

8 import { CustomHttpParams } from '../../models';

fickle tartan
#

If that does not solve your problem. Can you post a repro?

wispy agate
#

I'm sorry I cannot provide one. I'm at the section you've linked and I've added an index.ts in each directory and pointed that ng-package.json to it. And as described I've added this to my tsconfig.lib.json

 "paths": {
      "@comp/*": ["./src/*"],
      "@comp/": ["./src/"]
    }

I'd assume I could then import from @comp/services/ but my ide can't resolve it and trys to import with ``../../models`

wispy agate
#

no clue really, is there something I could have a look and?