SSR build fix

This commit is contained in:
Amit Jakubowicz 2019-10-10 12:42:11 +02:00
parent 78cc43af4a
commit 67101b30a1
4 changed files with 27 additions and 30 deletions

View file

@ -6,7 +6,7 @@
"private": true,
"scripts": {
"build": "webpack --config ./webpack.config.ts",
"start": "NODE_ENV=development webpack-dev-server --config ./webpack.config.ts --hot --progress"
"start": "API_URL=http://alpha.quepasaalpujarra.com/graphql webpack --config ./webpack.config.ts --watch --progress"
},
"dependencies": {
"@babel/node": "^7.6.2",

View file

@ -10,7 +10,7 @@
]
},
"include": [
"packages", "@types/index.d.ts"],
"../../@types/index.d.ts", "../../@types/graphql.d.ts"],
"exclude": [
".*/__tests__/.*", "node_modules", "dist", "lib", "__tests__"
]

View file

@ -10,18 +10,13 @@ import {Helmet} from 'react-helmet'
import AppMessages from './App.msg.json'
const App = () => {
const [intlInit, setIntlInit] = React.useState(false)
intl.init({
currentLocale: 'es-ES',
locales: {
'en-GB': AppMessages.en,
'es-ES': AppMessages.es
}
}).then(() => setIntlInit(true))
if (!intlInit) {
return null
}
})
return (
<Root>
<Helmet>

View file

@ -11,27 +11,29 @@ import Signout from "./Auth/Signout"
import Signup from "./Auth/Signup"
import OccurrenceDetails from "./Occurrence/OccurrenceDetails"
const Routes = () => (
<Switch>
<Route path="/create" component={CreateEvent}/>
<Route
path="/event/:eventId/edit"
render={(routeProps: RouteComponentProps<{ eventId: string }>) => (
<EditEvent eventId={routeProps.match.params.eventId}/>
)}
/>
<Route
path="/o/:sanitizedEventName/:occurrenceId"
component={OccurrenceDetails}
/>
<Route path="/init-session/:hash" component={InitializeSession}/>
<Route path="/login" component={Login}/>
<Route path="/signup" component={Signup}/>
<Route path="/logout" component={Signout}/>
<Route path="/:month" component={Calendar}/>
<Route path="/" component={Calendar}/>
<Redirect to="/"/>
</Switch>
)
const Routes = () => {
return (
<Switch>
<Route path="/create" component={CreateEvent}/>
<Route
path="/event/:eventId/edit"
render={(routeProps: RouteComponentProps<{ eventId: string }>) => (
<EditEvent eventId={routeProps.match.params.eventId}/>
)}
/>
<Route
path="/o/:sanitizedEventName/:occurrenceId"
component={OccurrenceDetails}
/>
<Route path="/init-session/:hash" component={InitializeSession}/>
<Route path="/login" component={Login}/>
<Route path="/signup" component={Signup}/>
<Route path="/logout" component={Signout}/>
<Route path="/:month" component={Calendar}/>
<Route path="/" component={Calendar}/>
<Redirect to="/"/>
</Switch>
)
}
export default Routes