ncc icon indicating copy to clipboard operation
ncc copied to clipboard

CLI, add option to change out "index.js" default name.

Open gomes042 opened this issue 5 years ago • 4 comments

Just like https://github.com/zeit/ncc/issues/492 did, I would like to suggest an option to change the default name of the output file after running the command line. Apparently you can change the name of the folder and that's cool but in some situations, like working with pm2 for example, it would be essential to have different names for each application than having several "index" in a large list. Currently I've created my own script to perform a simple task of renaming the index.js file after transpilation to any name I want, but it would be very interesting to have this option natively in the cli as '--filename' for example.

gomes042 avatar May 13 '20 10:05 gomes042

Here's another use-case: I want to bundle both main.ts and preload.ts in an Electron app (for faster launch time). Having both renamed to index.js doesn't make sense in this case. An option would save two && mv dist/index.js dist/preload.js (which is not even cross platform).

Prinzhorn avatar Aug 29 '20 17:08 Prinzhorn

i my self create in that situation a build-src folder that simply contains symbolic links then i run ncc over that files and get the desired output while maintaining a single real source file and i maintain no additional code.

frank-dspeed avatar Jan 29 '22 12:01 frank-dspeed

i found out that maybe -a, --asset-builds Build nested JS assets recursively, useful for when code is loaded as an asset eg for workers. is the solution for that

frank-dspeed avatar Jan 30 '22 13:01 frank-dspeed

definitely needed feature.

ttodua avatar Apr 09 '24 12:04 ttodua