cloverfield-tools / cf-package

Cloverfield Package Scaffold
MIT License
98 stars 14 forks source link

build directory ignored by npm #47

Open finnfiddle opened 8 years ago

finnfiddle commented 8 years ago

Hi there,

maybe I am doing something the wrong way here but I created a new module by following the instructions in the README.

Then I edited the source/index.js and test/index.js files accordingly. And then hit npm publish.

When I installed it in another project by doing npm install my-module if I try include my module somewhere like const x = require('my-module'); it is unable to resolve it.

I see in the package.json file for my module it has this "main": "build/index.js", but if I go into the node_modules/my-module directory of my project I see there is no build directory.

Am I missing something that you know of, and is there possibly something unique with my setup or is this common behaviour of NPM? Thanks in advance

finnfiddle commented 8 years ago

I see now that its being ignored in the .npmignore file. but I dont understand how it should be present after being installed if its ignored

nkbt commented 8 years ago

I had to create a workaround (zipping and unzipping template), so npm does not ignore some scripts from a template on publish. You can see how it works in https://github.com/nkbt/cf-react-component-template

I reckon this needs to be updated.