Skip to content

Scoped npm package doesn't resolved without explicit path including node_modules #686

@dubaua

Description

@dubaua

Hello.

I'm using microbundle for bundling a small JS library that internally uses another my JS library bundled with microbundle.

Both libraries are scoped in my username on npm, because many good and short names already taken. So, my problem is I should explicitly write this:

import mergeOptions from '/node_modules/@dubaua/merge-options';

instead of this:

import mergeOptions from '@dubaua/merge-options';

If I'm doing as second line above I'm getting warnings on building:

'/node_modules/@dubaua/merge-options' is imported by get-declension.js, but could not be resolved – treating it as an external dependency
No name was provided for external module '/node_modules/@dubaua/merge-options' in output.globals – guessing 'mergeOptions'

And the dependent library is not included in the JS bundle.

This is not a big problem on my get-declension library, but I have worst issue with another library, that I cannot bundle at all.

Possibly this strange thing more related to rollup, I don't know.

I will greatly appreciate any help or suggestions are.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions