Skip to content

How to support 'multiple files' #2

@damiensawyer

Description

@damiensawyer

Thank you for a brilliant article and example. It was really helpful.

I'm wondering if I can bother you with a quesiton.

You have your shared code in a single index.ts file. You then export "./build/index.js" as "main" in package.json. This makes it easy to import.

How would you handle a second file alongside index.ts? Say maths.ts with a single function it it. I've been playing around with it for a while but cannot seem to be able to import it without something like

import { Add } from "@monorepo/utils/build/maths"

It seems 'wrong to me to have to refer to the build folder in that from statement.

Is there some way around this?

Thank you for any help!!

DS

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