sveltejs/sapper

Can sapper be built with Typescript in a pnpm monorepo without being the root project?

Closed this issue · 4 comments

Project uses a pnpm monorepo. One of the projects is a sapper app using rollup & @rollup/plugin-typescript.

sapper build

Has an error:

Debug Failure. False expression: Expected fileName to be present in command line

Excerpt from https://dev.to/dagatsoin/wizar-devlog-10-hell-of-ts-bundling-1m5f:

I use Rollup to compile my TS in a single file.
It is straigh forward and really 0 config. My main issue is that I used a monorepo and one of my package used another one.

In this case you have too start your script in the root folder of your monorepo. Otherwize you will end with: "Debug Failure. False expression: Expected fileName to be present in command line"

The excerpt indicates that it would be possible to fix this issue by running the build from the root monorepo project. I'm not aware of how to run sapper build from a parent directory. Is this currently possible?

Not that I'm aware of

Then, it seems like it's not possible to use sapper with typescript in a monorepo with the current set of tools.

There's at least three different Rollup TypeScript plugins. Maybe try one of the others. rollup-plugin-typescript2 is the most popular

Thank you. rollup-plugin-typescript2 fixed the issue.