-2

I have a library create with angular 9 with a project structure like below

project description

When I build the library ng build falcon-core the view-models files are not included in the dist folder

enter image description here

I didn't find any settings related to the files structure in the tsconfig.lib.ts

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "outDir": "../../out-tsc/lib",
    "target": "es2015",
    "declaration": true,
    "inlineSources": true,
    "types": [],
    "lib": [
      "dom",
      "es2018"
    ]
  },
  "angularCompilerOptions": {
    "skipTemplateCodegen": true,
    "strictMetadataEmit": true,
    "enableResourceInlining": true
  },
  "exclude": [
    "src/test.ts",
    "**/*.spec.ts"
  ]
}

why the files are not included in the dist folder after build.

San Jaisy
  • 15,327
  • 34
  • 171
  • 290

1 Answers1

0

The answer was simple, but I was not aware of

Need to update the public-api.ts file to expose the files

export * from './lib/view-models/imeta';
export * from './lib/view-models/component-type-enum';
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
  • Something to add from my very recent experience...if the files are use in the lib code they are included in the "bundle" and can be referenced in the consuming app but if said classes, services etc were not put in the public-api.ts then you eventually get a build error saying as much! – Ben Thomson Apr 05 '23 at 07:26