runem / lit-analyzer

Monorepository for tools that analyze lit-html templates
MIT License
319 stars 38 forks source link

No missing imports does not analyze code files that import custom elements #136

Open Christian24 opened 4 years ago

Christian24 commented 4 years ago

Hello,

we stumbled upon something interesting today: We have a source file that defines some constants that contain a method that imports custom elements. They are route definitions for lazy loading. Look at the following example:

// routes.ts
export const ERROR_ROUTE = {name: 'error', path: 'error', load: () => import('../pages/error')};

Now if we import ERROR_ROUTE in some other file, lit-analyzer, will stumble upon ERROR_ROUTE and will then try to analyze routes.ts, but instantly exit due to the module depth. This seems to be generally desired, but in our case we would like to have routes.ts to be analyzed as well similar to how facade modules are analyzed today.

Thanks a lot, Christian