Skip to content

Commit

Permalink
fix: fix scss compile order
Browse files Browse the repository at this point in the history
  • Loading branch information
DaiQiangReal committed Apr 1, 2024
1 parent 3660c32 commit 8e3caec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/semi-scss-compile/src/utils/writeFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ const preProcessScssMap = (scssMapOrigin: ReturnType<typeof generateScssMap>) =>
const customScssRaw = scssMap.theme['custom.scss'];
let allCustomRaw = '';
if (customScssRaw) {
for (const componentName of Object.keys(scssMap['components'])) {
const componentNames = Object.keys(scssMap['components']);
const orderList = ['tooltip', 'anchor', 'autoComplete', 'avatar', 'backtop', 'badge', 'banner', 'breadcrumb', 'button', 'calendar', 'card', 'carousel', 'cascader', 'checkbox', 'collapse', 'collapsible', 'datePicker', 'descriptions', 'divider', 'dropdown', 'empty', 'form', 'grid', 'highlight', 'image', 'input', 'inputNumber', 'list', 'modal', 'navigation', 'notification', 'pagination', 'popconfirm', 'popover', 'progress', 'radio', 'rating', 'scrollList', 'select', 'sideSheet', 'skeleton', 'slider', 'space', 'spin', 'steps', 'switch', 'table', 'tabs', 'tag', 'tagInput', 'timePicker', 'timeline', 'toast', 'transfer', 'tree', 'treeSelect', 'typography', 'upload'];

componentNames.sort((a,b)=>{
return orderList.indexOf(a) - orderList.indexOf(b);
});

for (const componentName of componentNames) {
if (scssMap['components'][componentName]['variables.scss']) {
allCustomRaw+= scssMap['components'][componentName]['variables.scss']+'\n';
}
Expand Down
1 change: 1 addition & 0 deletions packages/semi-webpack/src/componentName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ const componentVariablePathList: string[] = [
'@douyinfe/semi-foundation/upload/variables.scss'
];


export default componentVariablePathList;

0 comments on commit 8e3caec

Please sign in to comment.