Skip to content

Typescript Type Dependencies Not Found #50

@abirmingham

Description

@abirmingham

Steps to Reproduce:

  1. Have a webpack 4 project with typescript.
  2. Create file TableRenderer.ts:
import { Table } from './Table';

const renderTable = (table: Table) => console.log(JSON.stringify(table));
  1. Create file Table.ts:
import * as TableRenderer from './TableRenderer';

export const renderMethods = TableRenderer;
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions