@@ -7,6 +7,7 @@ import postcss from 'postcss';
77import postcssPkg from 'postcss/package.json' ;
88import validateOptions from 'schema-utils' ;
99import { satisfies } from 'semver' ;
10+ import sortBy from 'lodash.sortby' ;
1011
1112import CssSyntaxError from './CssSyntaxError' ;
1213import Warning from './Warning' ;
@@ -21,7 +22,6 @@ import {
2122 getModulesPlugins ,
2223 normalizeSourceMap ,
2324 shouldUseModulesPlugins ,
24- sortByName ,
2525} from './utils' ;
2626
2727export default function loader ( content , map , meta ) {
@@ -137,16 +137,18 @@ export default function loader(content, map, meta) {
137137 }
138138 }
139139
140- imports . sort ( ( a , b ) => a . index - b . index ) ;
141140 apiImports . sort ( ( a , b ) => a . index - b . index ) ;
142141
143- const sortedImports = sortByName ( imports , [
144- 'CSS_LOADER_ICSS_IMPORT' ,
145- 'CSS_LOADER_AT_RULE_IMPORT' ,
146- 'CSS_LOADER_GET_URL_IMPORT' ,
147- 'CSS_LOADER_URL_IMPORT' ,
148- 'CSS_LOADER_URL_REPLACEMENT' ,
149- ] ) ;
142+ /*
143+ * Order
144+ * CSS_LOADER_ICSS_IMPORT: [],
145+ * CSS_LOADER_AT_RULE_IMPORT: [],
146+ * CSS_LOADER_GET_URL_IMPORT: [],
147+ * CSS_LOADER_URL_IMPORT: [],
148+ * CSS_LOADER_URL_REPLACEMENT: [],
149+ * */
150+
151+ const sortedImports = sortBy ( imports , [ 'order' , 'index' ] ) ;
150152
151153 const { localsConvention } = options ;
152154 const esModule =
0 commit comments