@@ -37,13 +37,9 @@ const sourcePath = path.resolve(__dirname, '../../components');
3737const targetPath = path . resolve ( __dirname , '../../publish' ) ;
3838const componentFolders = fs . readdirSync ( targetPath ) ;
3939
40- // Export each component's style in `component.less` and copy it to the target dir.
41- let componentsLessContent = '' ;
42-
4340componentFolders . forEach ( dir => {
4441 if ( fs . existsSync ( `${ sourcePath } /${ dir } /style/index.less` ) ) {
4542 // Copy style files for each component.
46- componentsLessContent += `@import "./${ path . posix . join ( dir , 'style' , 'index.less' ) } ";\n` ;
4743 fs . copySync ( `${ sourcePath } /${ dir } /style` , `${ targetPath } /${ dir } /style` ) ;
4844
4945 // Compile less files to CSS and delete the `entry.less` file.
@@ -69,13 +65,13 @@ componentFolders.forEach(dir => {
6965
7066// Copy concentrated less files.
7167fs . copySync ( path . resolve ( sourcePath , 'style' ) , path . resolve ( targetPath , 'style' ) ) ;
72- fs . writeFileSync ( `${ targetPath } /components.less` , componentsLessContent ) ;
68+ fs . writeFileSync ( `${ targetPath } /components.less` , fs . readFileSync ( ` ${ sourcePath } /components.less` ) ) ;
7369fs . writeFileSync ( `${ targetPath } /ng-zorro-antd.less` , fs . readFileSync ( `${ sourcePath } /ng-zorro-antd.less` ) ) ;
7470
7571// Compile concentrated less file to CSS file.
7672const lessContent = `@import "${ path . posix . join ( targetPath , 'ng-zorro-antd.less' ) } ";` ;
77- compileLess ( lessContent , path . join ( targetPath , 'ng-zorro-antd.css' ) , false ) ;
78- compileLess ( lessContent , path . join ( targetPath , 'ng-zorro-antd.min.css' ) , true ) ;
73+ compileLess ( lessContent , path . join ( targetPath , 'ng-zorro-antd.css' ) , false ) . catch ( e => console . log ( e ) ) ;
74+ compileLess ( lessContent , path . join ( targetPath , 'ng-zorro-antd.min.css' ) , true ) . catch ( e => console . log ( e ) ) ;
7975
8076// Compile css file that doesn't have component-specific styles.
8177const cssIndexPath = path . join ( sourcePath , 'style' , 'entry.less' ) ;
0 commit comments