@@ -46,21 +46,6 @@ const supportedRemixConfigKeys = [
46
46
type SupportedRemixConfigKey = typeof supportedRemixConfigKeys [ number ] ;
47
47
type SupportedRemixConfig = Pick < RemixUserConfig , SupportedRemixConfigKey > ;
48
48
49
- const ROUTE_EXPORTS = new Set ( [
50
- "ErrorBoundary" ,
51
- "HydrateFallback" ,
52
- "action" ,
53
- "clientAction" ,
54
- "clientLoader" ,
55
- "default" , // component
56
- "handle" ,
57
- "headers" ,
58
- "links" ,
59
- "loader" ,
60
- "meta" ,
61
- "shouldRevalidate" ,
62
- ] ) ;
63
-
64
49
const SERVER_ONLY_EXPORTS = [ "loader" , "action" , "headers" ] ;
65
50
66
51
// We need to provide different JSDoc comments in some cases due to differences
@@ -1156,23 +1141,6 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => {
1156
1141
let route = getRoute ( pluginConfig , id ) ;
1157
1142
if ( ! route ) return ;
1158
1143
1159
- // check the exports, fail if unknown exists, unless id ends with .mdx
1160
- let nonRemixExports = esModuleLexer ( code ) [ 1 ]
1161
- . map ( ( exp ) => exp . n )
1162
- . filter ( ( exp ) => ! ROUTE_EXPORTS . has ( exp ) ) ;
1163
- if ( nonRemixExports . length > 0 && ! id . endsWith ( ".mdx" ) ) {
1164
- let message = [
1165
- `${ nonRemixExports . length } invalid route export${
1166
- nonRemixExports . length > 1 ? "s" : ""
1167
- } in \`${ route . file } \`:`,
1168
- ...nonRemixExports . map ( ( exp ) => ` - \`${ exp } \`` ) ,
1169
- "" ,
1170
- "See https://remix.run/docs/en/main/future/vite#strict-route-exports" ,
1171
- "" ,
1172
- ] . join ( "\n" ) ;
1173
- throw Error ( message ) ;
1174
- }
1175
-
1176
1144
if ( pluginConfig . isSpaMode ) {
1177
1145
let serverOnlyExports = esModuleLexer ( code ) [ 1 ]
1178
1146
. map ( ( exp ) => exp . n )
0 commit comments