Do you want to request a feature or report a bug?
bug
What is the current behaviour?
Exports beyond default exports from route components are not working.
If the current behaviour is a bug, please provide the steps to reproduce.
Export anything besides default from a component in the routes directory and try to import it in another file. There's a warning from webpack and the import will be undefined.
What is the expected behaviour?
Exports beyond the default export from a route component should work.
If this is a feature request, what is motivation or use case for changing the behaviour?
Please mention other relevant information.
Example repo: https://github.com/yoshiwarab/preact-export-bug
Yup it's because of the async loader, we're not quite sure how to fix it
If you rename the directory it will work
This is an intentional limitation that ensures effective code splitting. For components that need named exports, place them in a directory that doesn't trigger automatic code splitting. You can then manually code-split the default export by re-exporting it from routes/ or importing it with the "async!" prefix.
For more information on this, please refer to the Route Based Code Splitting in README.
Most helpful comment
Yup it's because of the async loader, we're not quite sure how to fix it
If you rename the directory it will work