-
Notifications
You must be signed in to change notification settings - Fork 191
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
[Question] Package with multiple exports
folders
#260
Comments
Sort of a hack, but here is how I did it: alpha0010/react-native-pdf-viewer@c7c41ea .
// In utils/package.json
{
"main": "../lib/commonjs/MyScript",
"module": "../lib/module/MyScript",
"react-native": "../src/MyScript",
"types": "../lib/typescript/MyScript.d.ts"
} With this, |
Couldn't make it work, so I replaced |
@kaueDM can you share the repository so that we can see how you did it? Thanks |
@kaueDM can you share your rollup solution, please? |
I want to share how I solved this: /my-lib/utils/package.json {
"main": "../lib/commonjs/utils",
"module": "../lib/module/utils",
"react-native": "../src/utils"
} Next, include this directory in the files section of your library's main package.json: {
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
"react-native": "src/index.js"
...
"files": [
"build",
"src",
"utils"
],
} With this setup, you will be able to import utilities like so: import { someUtil } from 'my-lib/utils'; This approach allows for a clear directory structure and makes it easier to import specific utilities from your library anywhere in your project. |
Ask your Question
How can I setup builder-bob to output multiple
exports
?I want to export some
utils
in a different path (like "/my-lib/utils"), but couldn't figure it out yet looking the source code/issues.The text was updated successfully, but these errors were encountered: