S
S
SuspenseDev2021-07-05 22:56:40
Web development
SuspenseDev, 2021-07-05 22:56:40

How not to build a typescript module before importing it into a monorepository?

Greetings!

There is a test monorepository .

The backend package in packages/backend/main.js tries to import a function from packages/common.
The problem is that an error occurs: The SyntaxError: Unexpected token 'export'

error can be avoided by changing package.json -> main: "./dist/index.js" in the common package and building the common package itself.
Question for connoisseurs: how to achieve not building the common package before importing its modules with other packages?

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question