3

I'm trying to publish a module I have created. The module has multiple entries in it and I want to publish from within my build folder.

Every time I try to publish with yarn. I get:

Output: The following paths are ignored by one of your .gitignore files: build/package.json Use -f if you really want to add them.

I tried yarn publish build And also cd build && yarn publish where I copy the package.json and npmignore and all the relevant files.

It's always the same result.

I have a .gitignore in my root and an .npmignore in my root.

If I publish the build folder from the root it works but I dont want the path to include the build/lib folder.

If I do yarn build && cd build && npm publish && cd ../ that will also work. But I'd rather use yarn.

Does anyone have a solution for it?

All I want is to publish my already created build folder content. I have all the needed files there.

EDIT

After much research and looking into other packages,

I ended up just creating a small copy script that copies my essential files to a build folder and clears up my package.json from all unwanted items.

Then my ci publishes from the build folder. That was our solution that we've implemented

Jony-Y
  • 1,579
  • 1
  • 13
  • 30

0 Answers0