@@ -1610,8 +1610,6 @@ const defaultIgnore = [
16101610 '**/.vscode-test-web/**' ,
16111611] ;
16121612
1613- const notIgnored = [ '!package.json' , '!README.md' ] ;
1614-
16151613async function collectAllFiles (
16161614 cwd : string ,
16171615 dependencies : 'npm' | 'yarn' | 'none' | undefined ,
@@ -1647,8 +1645,12 @@ function collectFiles(
16471645 dependencies : 'npm' | 'yarn' | 'none' | undefined ,
16481646 dependencyEntryPoints ?: string [ ] ,
16491647 ignoreFile ?: string ,
1650- manifestFileIncludes ?: string [ ]
1648+ manifestFileIncludes ?: string [ ] ,
1649+ readmePath ?: string ,
16511650) : Promise < string [ ] > {
1651+ readmePath = readmePath ?? 'README.md' ;
1652+ const notIgnored = [ '!package.json' , `!${ readmePath } ` ] ;
1653+
16521654 return collectAllFiles ( cwd , dependencies , dependencyEntryPoints ) . then ( files => {
16531655 files = files . filter ( f => ! / \r $ / m. test ( f ) ) ;
16541656
@@ -1756,7 +1758,7 @@ export function collect(manifest: Manifest, options: IPackageOptions = {}): Prom
17561758 const ignoreFile = options . ignoreFile || undefined ;
17571759 const processors = createDefaultProcessors ( manifest , options ) ;
17581760
1759- return collectFiles ( cwd , getDependenciesOption ( options ) , packagedDependencies , ignoreFile , manifest . files ) . then ( fileNames => {
1761+ return collectFiles ( cwd , getDependenciesOption ( options ) , packagedDependencies , ignoreFile , manifest . files , options . readmePath ) . then ( fileNames => {
17601762 const files = fileNames . map ( f => ( { path : util . filePathToVsixPath ( f ) , localPath : path . join ( cwd , f ) } ) ) ;
17611763
17621764 return processFiles ( processors , files ) ;
@@ -1915,6 +1917,7 @@ export interface IListFilesOptions {
19151917 readonly ignoreFile ?: string ;
19161918 readonly dependencies ?: boolean ;
19171919 readonly prepublish ?: boolean ;
1920+ readonly readmePath ?: string ;
19181921}
19191922
19201923/**
@@ -1928,7 +1931,7 @@ export async function listFiles(options: IListFilesOptions = {}): Promise<string
19281931 await prepublish ( cwd , manifest , options . useYarn ) ;
19291932 }
19301933
1931- return await collectFiles ( cwd , getDependenciesOption ( options ) , options . packagedDependencies , options . ignoreFile , manifest . files ) ;
1934+ return await collectFiles ( cwd , getDependenciesOption ( options ) , options . packagedDependencies , options . ignoreFile , manifest . files , options . readmePath ) ;
19321935}
19331936
19341937interface ILSOptions {
@@ -1937,6 +1940,7 @@ interface ILSOptions {
19371940 readonly packagedDependencies ?: string [ ] ;
19381941 readonly ignoreFile ?: string ;
19391942 readonly dependencies ?: boolean ;
1943+ readonly readmePath ?: string ;
19401944}
19411945
19421946/**
0 commit comments