function formatFileName (format, fileName, pattern) {
    let name = path.basename(fileName).replace(path.extname(fileName), '');

    if (typeof pattern === 'string') {
        return pattern.replace('[name]', name)
            .replace('[extname]', path.extname(fileName))
            .replace('[ext]', path.extname(fileName).substring(1))
            .replace('[format]', format === 'es'? 'esm' : format);
    }
 
    // TODO: Function pattern implementation
    return '';
}
@param {string} format 
@param {string} fileName 
@param {string|function(RollupPreRenderedFile): string} pattern 
@return {string}