Steps to Reproduce:
- Have a webpack 4 project with typescript.
- Create file
TableRenderer.ts:
import { Table } from './Table';
const renderTable = (table: Table) => console.log(JSON.stringify(table));
- Create file
Table.ts:
import * as TableRenderer from './TableRenderer';
export const renderMethods = TableRenderer;
- Run webpack with
circular-dependency-plugin enabled.
Expected Result: Circular dependency of TableRenderer -> Table -> TableRenderer.
Actual Result: No circular dependency found.
Due to type erasure, and the circular-dependency-plugin's usage of compilation.hooks.optimizeModules, it looks like this isn't easily solvable. Perhaps there is a hook earlier in the webpack life cycle that provides dependencies prior to type erasure? I'm not sure.
Steps to Reproduce:
TableRenderer.ts:Table.ts:circular-dependency-pluginenabled.Expected Result: Circular dependency of
TableRenderer -> Table -> TableRenderer.Actual Result: No circular dependency found.
Due to type erasure, and the
circular-dependency-plugin's usage ofcompilation.hooks.optimizeModules, it looks like this isn't easily solvable. Perhaps there is a hook earlier in the webpack life cycle that provides dependencies prior to type erasure? I'm not sure.