diff --git a/app/hooks/useLocalizeLink.ts b/app/hooks/useLocalizeLink.ts index 9e62834..b25c474 100644 --- a/app/hooks/useLocalizeLink.ts +++ b/app/hooks/useLocalizeLink.ts @@ -1,6 +1,7 @@ import { useTranslation } from 'react-i18next' -import routes from '../pages/_routes.js' +const routes = require('../pages/_routes.js') +// import routes from '~/pages/_routes.js' export const useLocalizeLink = () => { const { i18n } = useTranslation() diff --git a/app/pages/_routes.js b/app/pages/_routes.js index 4b267fb..b815120 100644 --- a/app/pages/_routes.js +++ b/app/pages/_routes.js @@ -1,6 +1,7 @@ // const global_routes = require('./global_routes.js') +// const skialper_routes = require('./skialper_routes.js') const skialper_routes = require('./skialper_routes.js') const allRoutes = [...skialper_routes] -export default allRoutes +module.exports = allRoutes diff --git a/app/utils.ts b/app/utils.ts index eacf221..cc6bbe0 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -1,4 +1,5 @@ -import routes from './pages/_routes.js' +// import routes from './pages/_routes.js' +const routes = require('~/pages/_routes.js') export function validateEmail(email: unknown): email is string { return typeof email === 'string' && email.length > 3 && email.includes('@') diff --git a/remix.config.js b/remix.config.js index 82beb5e..75839d4 100644 --- a/remix.config.js +++ b/remix.config.js @@ -1,6 +1,8 @@ /** @type {import('@remix-run/dev').AppConfig} */ // Import routes.js -// const routes = require('./app/pages/_routes.js') +const routes = require('./app/pages/_routes.js') +// import routes from './app/pages/skialper_routes.js' +console.log(routes) module.exports = { cacheDirectory: './node_modules/.cache/remix', @@ -31,18 +33,20 @@ module.exports = { // If you need to do async work, do it before calling `defineRoutes`, we use // the call stack of `route` inside to set nesting. + // const routes = require('./app/pages/_routes.mjs') + return defineRoutes((route) => { - route('/about', 'pages/skialper/about._index.tsx') - // routes.forEach((r) => { - // route(r.path, r.component, { - // id: `it-${r.path}`, - // }) - // }) - // routes.forEach((r) => { - // route(r.originalPath, r.component, { - // id: `en-${r.originalPath}`, - // }) - // }) + // route('/about', 'pages/skialper/about._index.tsx') + routes.forEach((r) => { + route(r.path, r.component, { + id: `it-${r.path}`, + }) + }) + routes.forEach((r) => { + route(r.originalPath, r.component, { + id: `en-${r.originalPath}`, + }) + }) }) }, }