Rollup [name] is not exported from [package] - using monorepo

Viewed 170

I have index file in my monorepo package which exports everything from the package by using:

export * from './api'
export * from './store'

Then in another package I want to use the api, so I import it by using:

import {Api} from "@project/shared";

The production rollup build fails, saying that Api is not exported from '../dist/index.js'. But it is actually exported because I can use it in other monorepo packages. What i've tried is to use exports: named option, but it didn't help. Also I've read a lot of info about monorepos with lerna and rollup but I can't find why the build fails. Also in my rollup config I am using resolve and commonjs rollup modules.

0 Answers
Related