-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monorepo example, using @rollup/plugin-alias
#237
Comments
Could you try setting |
just tried it but got again:
|
I think I found the solution: alias({
entries: [{ find: 'greeter', replacement: '../greeter/index.mjs' }],
^
}) it needs to be Then it compiles flawlessly! I don't know why tho. ;) |
When compilerOptions.rootDir is specified, it is used instead of process.cwd() to filter files. Possible fix for ezolenko#237
I got the exact same issue, and I think I spotted the issue.
In imports `../utils/utils.ts` To my understanding, compiling **My fix goes at return createRollupFilter(included, excluded, { resolve: parsedConfig.options.rootDir }); This way, if @ezolenko you will find the fix in my PR above. |
When compilerOptions.rootDir is specified, it is used instead of process.cwd() to filter files. Possible fix for #237
PR is merged, build is in master. Could somebody with this problem verify if it works for them before I do a release? |
Released in 0.29.0 |
Thank you! |
This is probably because at the time of this issue (and even now to some extent), Node's ESM support was not supported by all tooling. Notably TS 4.7 is the first version of TS to officially support
As such I believe these are actually two different issues with different root causes -- just similar error messages (this is a very common Rollup error message). So there were kind of two issues in one on this thread, each a different monorepo issue. |
@rollup/plugin-alias
What happens and why it is wrong
Environment
I am trying to setup a monorepo with local packages. I am using pnpm workspaces but could also go with tsconfig's paths features. Whatever, I don't get it to work and would love to see an example where somebody gets a monorepo working with this plugin.
My problem is that I get this all the time:
note that the imported local package (
greeter
) has a index.js, index.mjs and index.d.ts fileVersions
rollup.config.js
tsconfig.json
package.json
plugin output with verbosity 3
The text was updated successfully, but these errors were encountered: