How to capitalize the first letter of the webpack output option [name]

for example, my entry file is input.js, then [name] is input,. Now I want to generate such an output:"xxInput.js",. I tried to write a function firstUpperCase, with uppercase letters by myself, and then output: xx$ {firstUpperCase ([name])} , I reported an error when packing, so how should I write it?

May.14,2021

your way of writing is literal, and webpack doesn't know it.

output.filename can also pass parameters of type function, for example:

output: {
    filename: function(chunkData){
        //  chunkData.chunk.name 
        return 'whatever.[name].js'
    }
}

{
    entry:{
        xxInput:'/path/to/input.js'
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b469-412c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b469-412c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?