You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to avoid doing it because for every newFile.ts I add to my project , I have to add "./newFile": "./dist/newFile.js" to exports.
Also there maybe a subfolder like src/utils/subUtils/fixName.ts I need it to simply can import like import myFixName from "test-package/subUtils/fixName";.
I have tried following:
1- adding "main": "dist/" to package.json
2- npm publish ./dist
3- using rollup input for my entries that you can see in the sample.
So I need to publish dist folder with the following structure that when someone install it, she/he only see these files and can import as I mentioned above.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am using
vitev:5.2.8for building my project,you can see sample in stacklibz here: https://stackblitz.com/edit/vite-yjxjye
This is my project structure:
I have two problem:
1 - I expect following structure in my dist folder:
but I have:
2- After I publish my package using
npm publishI can't import my component like this:My package is a big utility that contains hundered of files so I don't want to do the following:
in
package.jsonwe can haveexportslike:I want to avoid doing it because for every
newFile.tsI add to my project , I have to add"./newFile": "./dist/newFile.js"toexports.Also there maybe a subfolder like
src/utils/subUtils/fixName.tsI need it to simply can import likeimport myFixName from "test-package/subUtils/fixName";.I have tried following:
1- adding
"main": "dist/"topackage.json2-
npm publish ./dist3- using rollup input for my
entriesthat you can see in the sample.So I need to publish
distfolder with the following structure that when someone install it, she/he only see these files and can import as I mentioned above.Beta Was this translation helpful? Give feedback.
All reactions