There was an issue where grommet-icons modules were choosing es5 versions whereas grommet was choosing es6 versions. This caused multiple versions of grommet-icons ThemeContext to be loaded, which doesn't work. The reason this happened is because reverse() was being used to put 'es6' before 'components' in grommet but was causing 'icons' to be put before 'es6' in grommet-icons.
The change is to first filter down to matching modules and then sort to use the preferred version based on 'es6' explicitly.
There was an issue where grommet-icons modules were choosing es5 versions whereas grommet was choosing es6 versions. This caused multiple versions of grommet-icons ThemeContext to be loaded, which doesn't work. The reason this happened is because
reverse()
was being used to put 'es6' before 'components' in grommet but was causing 'icons' to be put before 'es6' in grommet-icons.The change is to first filter down to matching modules and then sort to use the preferred version based on 'es6' explicitly.