-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: webpack config split * chore: import react from cdn * chore: update readmes * chore: add script to start prod build locally Signed-off-by: Carina Ursu <[email protected]>
- Loading branch information
1 parent
cbc210c
commit f93e94f
Showing
15 changed files
with
666 additions
and
674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700|Open+Sans:400,700" rel="stylesheet"> | ||
<meta charset="UTF-8" /> | ||
<title>Flyte Console</title> | ||
<meta name="viewport" content="width=device-width" /> | ||
<link | ||
href="https://fonts.googleapis.com/css?family=Lato:300,400,700|Open+Sans:400,700" | ||
rel="stylesheet" | ||
/> | ||
|
||
<script>window.env = <%= htmlWebpackPlugin.options.clientEnv %></script> | ||
</head> | ||
<body> | ||
<div id="react-app"></div> | ||
<% if (htmlWebpackPlugin.options.cdnReact) { %> | ||
<script crossorigin src="<%= htmlWebpackPlugin.options.cdnReact %>"></script> | ||
<% } %> <% if (htmlWebpackPlugin.options.cdnReactDOM) { %> | ||
<script crossorigin src="<%= htmlWebpackPlugin.options.cdnReactDOM %>"></script> | ||
<% } %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as express from 'express'; | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
interface ServerRendererArguments { | ||
currentDirectory: string; | ||
} | ||
|
||
/** | ||
* Universal render function in development mode | ||
*/ | ||
export default function serverRenderer({ currentDirectory }: ServerRendererArguments) { | ||
const html = fs.readFileSync(path.join(currentDirectory, 'dist/index.html')).toString(); | ||
|
||
return (_req: express.Request, res: express.Response) => { | ||
if (html === '') { | ||
throw new ReferenceError('Could not find index.html to render'); | ||
} | ||
|
||
res.status(200).send(html); | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.