1

I am following the Stencil guide for configuring an angular output target here and am facing a problem when it comes to exporting the generated angular components to make them accessible in a production build.

The generated angular directory (from stencil output targets) appears like so

enter image description here

when running a production build I get the error

enter image description here

I have seen this error before in other projects I have built, and I know I need to add an export of the components in the entry file for the lib.

In my top-level index.ts I have

export {DIRECTIVES} from './generated/directives';
export * from './lib/core-components-angular.module';

And in the generated/directives/index.ts from a stencil I have

import * as d from './proxies';

export const DIRECTIVES = [
  d.MyComponent
];

As per the stencil docs, I am pretty sure I have followed the steps they suggest

enter image description here

I am able to get the build to succeed if I use explicit component exports so

export {
    MyComponent,
    OtherComponent
} from './generated/directives/proxies';

But of course, the documented approach would be far better as a stencil will keep the exported DIRECTIVES constant updated for me as more components get added

So I am not sure where I am going wrong here, something trivial I am sure, can someone point out the problem, please?

Ehsan HP
  • 456
  • 2
  • 5
  • 16
mindparse
  • 6,115
  • 27
  • 90
  • 191
  • Isn't it documented here https://stenciljs.com/docs/angular#why-aren-t-my-custom-interfaces-exported-from-within-the-index-d-ts-file ? – Piero Oct 17 '22 at 12:28

0 Answers0