don't write file if main is `index`

Currently if main in `package.json` is `index`, the `index.js` file is overwritten with `module.exports = require("./index.js")`.