this code cannot be browserified
Pomax opened this issue · 3 comments
Pomax commented
By using this:
module.exports = require(process.env.COLOR_DIFFERENCE_COVERAGE
? './.coverage/lib'
: './lib'
);
Browserify cannot determine what it should actually include when building a package that uses color-difference. It's probably worth adding a main
property to your package.json that simply straight up points to ./lib/index.js
instead, and keep the root index.js exporting ./coverage/lib
:
...
"bin": {
"color-difference": "./bin/color-difference"
},
"main": "./lib",
"repository": {
"type": "git",
"url": "git://github.com/garex/nodejs-color-difference.git"
},
...
solves the problem of browserify breaking when color-difference
is used
garex commented
@Pomax hi. can you send some stupid PR on this? I'm currently "not here" mentally. I'll review I will understand more details.
Pomax commented
sure, I'll try get that done tonight