@react5/bundle-sass 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -1
- package/index.test.js +12 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -13,7 +13,9 @@ export function compareFiles(a, b) {
|
|
|
13
13
|
if (priorityDiff !== 0) {
|
|
14
14
|
return priorityDiff;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const nameA = path.basename(a.id);
|
|
17
|
+
const nameB = path.basename(b.id);
|
|
18
|
+
return nameA.localeCompare(nameB);
|
|
17
19
|
}
|
|
18
20
|
function copyFontFolders(emitFile) {
|
|
19
21
|
return async function (fontImport) {
|
package/index.test.js
CHANGED
|
@@ -3,13 +3,19 @@ import { compareFiles } from './index';
|
|
|
3
3
|
describe('prioritize files', () => {
|
|
4
4
|
it('should prioritize files', () => {
|
|
5
5
|
const files = [
|
|
6
|
-
{ id: '
|
|
7
|
-
{ id: '
|
|
8
|
-
{ id: '
|
|
6
|
+
{ id: 'atest\\2-file', content: 'content1' },
|
|
7
|
+
{ id: 'atest\\4-file', content: 'content2' },
|
|
8
|
+
{ id: 'atest\\3-file', content: 'content3' },
|
|
9
|
+
{ id: 'VoiceCommandListener\\VoiceCommandListener.scss', content: "content4" },
|
|
10
|
+
{ id: 'design-system\\src\\styles\\1-reset.scss', content: "content5"},
|
|
11
|
+
|
|
9
12
|
];
|
|
10
13
|
const sortedFiles = files.sort(compareFiles);
|
|
11
|
-
expect(sortedFiles[0].id).toEqual('1-
|
|
12
|
-
expect(sortedFiles[1].id).toEqual('2-
|
|
13
|
-
expect(sortedFiles[2].id).toEqual('3-
|
|
14
|
+
expect(sortedFiles[0].id).toEqual('design-system\\src\\styles\\1-reset.scss');
|
|
15
|
+
expect(sortedFiles[1].id).toEqual('atest\\2-file');
|
|
16
|
+
expect(sortedFiles[2].id).toEqual('atest\\3-file');
|
|
17
|
+
expect(sortedFiles[3].id).toEqual('atest\\4-file');
|
|
18
|
+
|
|
19
|
+
|
|
14
20
|
});
|
|
15
21
|
})
|