I'm currently writing a node CLI tool and using webpack to bundle all of my assets. The entry point for this application is the js file where I actually parse process.argv
and run a command (For reference, I'm using tj/commander). This way, once the bundling is complete, I can enter ./<outputFile>
and it will run my application. The entry file looks like this:
import cli from './cli';
cli.parse(process.argv);
// If nothing was supplied
if (!process.argv.slice(2).length) {
cli.outputHelp();
}
The bundling works fine but I can't get webpack to output the file as an executable. Once I run chmod +x <outputFile>
, everything works perfectly. Is there a way that I can tell webpack what permissions to grant an output file?