brendangibson
brendangibson

Reputation: 2542

How do I export from a module without the src directory?

I have two modules. One is a dependency of the other.

One module, base-module is structured like -

/
    /src
        /Widget
            index.tsx
package.json

and I want to import Widget into the other module.

I have added base-module as a dependency in its package.json.

It works if I write

import Widget from "base-module/src/Widget"

How do I get it to be

import Widget from "base-module/Widget" ?

I am using webpack and typescript.

Upvotes: 0

Views: 357

Answers (1)

Artur Schens
Artur Schens

Reputation: 136

Define index.tsx in base-module/ and import, export Widget there.

Upvotes: 1

Related Questions