tbranyen/diffhtml

Enhance the build

kltan opened this issue · 8 comments

kltan commented

I am thinking that the /dist folder should be added to .gitignore to reduce the diff noise and /lib is added to .npmignore. During prepublish we add the build script so that it's published to npm.

"prepublish": "npm run build && babel lib --source-maps -d dist/cjs"
kltan commented

@tbranyen If proposal is accepted I can open up a PR.

@kltan I've used the approach you're describing in quite a few of my other open source projects. The reason why I've stopped doing this for diffHTML and others, is that there is just too much utility in being able to point to a SHA and be able to test immediately.

I have a .gitattributes file added that will silence any dist files from showing up in local diffs, I really wish @github would support this as well.

Also if you ignore lib you're going to make life a lot harder for those who want to use the actual ES6 source.

kltan commented

@tbranyen Ah, makes sense, although it's still a pain in GitHub.

I totally agree, I really wish it could be nicer. My suggestion would be not to commit the dist files until you're ready to merge/test (if you want better looking diffs).

Lets keep this open for now though, I'd be interested in hearing if others feel the same way.

kltan commented

If ready means bumping the version, the build script probably can be run in preversion.

I'm going to keep as-is for now, it's been more convenient for me developing and the current .npmignore and cjs build scripts make a pretty flexible distribution.