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
-
I am using
vite
v:5.2.8
for 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 publish
I 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.json
we can haveexports
like:I want to avoid doing it because for every
newFile.ts
I add to my project , I have to add"./newFile": "./dist/newFile.js"
toexports
.Also there maybe a subfolder like
src/utils/subUtils/fixName.ts
I need it to simply can import likeimport myFixName from "test-package/subUtils/fixName";
.I have tried following:
1- adding
"main": "dist/"
topackage.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.Beta Was this translation helpful? Give feedback.
All reactions