SWC export order
This is an SWC plugin which injects an exported constant named __namedExportsOrder. This constant is defined as a string array of exported names in the module, in the order they were exported. Thus, the following example:
const a = 5
export const b = 'foo'
export
becomes
const a = 5
export const b = 'foo'
export
export const __namedExportsOrder =
As you can see, the order is dictated by when a name is exported, not by when it is defined.
Using the plugin
The plugin targets swc_core 5.0, meaning that it supports @swc/core 1.9. See https://plugins.swc.rs/ for details. Assuming you're using rspack, you can follow its documentation for an example for adding a plugin. You can also consult its reference for futher details. In short, you'll want to set your loader options to something like
module.exports = ;