Skip to content

Is it possible to import from the remix bundle? #10

@tadeaspetak

Description

@tadeaspetak

Hi there! First of all, thanks for this awesome repo, it showed me how to get started with a server file in TS which is exactly what I needed 🙏

I need to create a loader context and fetch a few things, such as the locale and user for that context. This is simple via the getLoadContext function.

But, in order to resolve locale and user, I need functions which I have available in the bundle built by the remix build command (which end up in build/index.js). Any idea as to the best way how to go about this? When I try to import them from the server.ts file built with esbuild, they are not automatically bundled in and naturally cannot be resolved from the built file at runtime.

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