@@ -59,18 +59,18 @@ export class AssetsManager {
5959 sourceRoot = join ( process . cwd ( ) , sourceRoot ) ;
6060
6161 const filesToCopy = assets . map < AssetEntry > ( ( item ) => {
62- if ( typeof item === 'string' ) {
63- return {
64- glob : join ( sourceRoot , item ) ,
65- outDir ,
66- } ;
67- }
62+ let includePath = typeof item === 'string' ? item : item . include ! ;
63+ let excludePath = typeof item !== 'string' && item . exclude ? item . exclude : undefined ;
64+
65+ includePath = join ( sourceRoot , includePath ) . replace ( / \\ / g , '/' ) ;
66+ excludePath = excludePath ? join ( sourceRoot , excludePath ) . replace ( / \\ / g , '/' ) : undefined ;
67+
6868 return {
69- outDir : item . outDir || outDir ,
70- glob : join ( sourceRoot , item . include ! ) ,
71- exclude : item . exclude ? join ( sourceRoot , item . exclude ) : undefined ,
72- flat : item . flat , // deprecated field
73- watchAssets : item . watchAssets ,
69+ outDir : typeof item !== 'string' ? item . outDir || outDir : outDir ,
70+ glob : includePath ,
71+ exclude : excludePath ,
72+ flat : typeof item !== 'string' ? item . flat : undefined , // deprecated field
73+ watchAssets : typeof item !== 'string' ? item . watchAssets : undefined ,
7474 } ;
7575 } ) ;
7676
0 commit comments