lthonny /
vanilla-todo-client
This site is a diary of tasks. Thanks to this project, I will plunge into the depths of the programming language and learn to master the principles of development.
Loading repository data…
mxjoly / repository
This project is a template of a server side rendering a React application with Webpack.
This project is a template of a server side rendering a React application.
General Setup
Libs and dependencies
Clone the repository, cd into the directory and run yarn (or npm install) on your command line to install all the dependencies. You're ready to go now !
There are npm scripts for all the relevant things. The server will always be started on port 8500 unless otherwise specified in process.env.PORT. You can use a .env file to specify env vars. If you want to use them in your client side code, don't forget to add them in config/env.ts.
yarn startStarts the app in development mode: creates a new client and server dev build using Webpack, starts the Express server build (for both file serving and server side pre-rendering) and keeps webpack open in watchmode. Updates the app (if possible) on change using HMR.
yarn buildCreates a new build optimized for production.
yarn cleanClean the build folder.
yarn testRun all tests using Jest.
yarn lint:jsRun ESLint for all JavaScript and TypeScript files.
yarn lint:cssRun Stylelint for all CSS files.
yarn lint:sassRun Stylelint for all SASS files.
yarn lintRun lint:js, lint:css and lint:sass in parallel.
yarn analyzeStarts webpack-bundle-analyzer to give you the opportunity to analyze your bundle(s).
yarn depgraphCreates an image of your dependency graph. Requires GraphVIZ.
yarn storybookRun the Storybook interface on the port 6006.
yarn build:storybookGenerate the static resources for Storybook. Useful to host online.
yarn formatFormat the files with Prettier, ESLint and Stylelint.
yarn plopDisplay intructions on the command line to create files easily.
There are a few environment variables you can set to adjust the setup to your needs
| Variable | Default | Description |
|---|---|---|
PORT | 8500 | Port number your application will be served |
HOST | http://localhost | Url (including protocol!) your application will be served on. |
DEVSERVER_HOST | http://localhost | Optional. Different host for the Webpack Dev Server to be served |
In some cases you might not want to generate source maps for the generated files. In this case you can set the SOURCEMAP environment variable to false. No source map files will be generated then. This works no matter if you're in devmode or building for production.
By default if you run npm start the development server will use port 8500. You can change this by specifying a PORT environment variable.
Set the PWA environment variable to true and add a file named app.json to the root of the project with your manifest properties :
| Key | Default | Description |
|---|---|---|
name | null | Your application's name. |
short_name | null | Your application's short_name. |
description | null | Your application's description. |
lang | en | Primary language for name and short_name |
dir | auto | The base direction in which to display direction-capable members of the manifest. |
background_color | #ffffff | Background colour for flattened icons. |
theme_color | #ffffff | Theme color user for example in Android's task switcher. |
display | standalone | Display mode: fullscreen, standalone, minimal-ui or browser. |
scope | / | set of URLs that the browser considers within your app |
start_url | /?utm_source=homescreen | Start URL when launching the application from a device. |
orientation | any | The orientation to use |
You can add more properties. For more informations see https://developer.mozilla.org/en-US/docs/Web/Manifest.
To complete the configuration of your web application, specify the path of your favicon in the file config/paths (you must use svg icon). When you finally enabled the environment for your web application, the metadata and the icons will be generated automatically for you. But you can still customize the icons generated by creating a file icons.json at the root of your project with the json schema defined there. If you do not want to generate the metadata or the icons, you can set the METADATA_GENERATION or ICONS_GENERATION environment variables to false.
Selected from shared topics, language and repository description—not editorial ratings.
lthonny /
This site is a diary of tasks. Thanks to this project, I will plunge into the depths of the programming language and learn to master the principles of development.
anousonefs /
this is starter project for react.js including webpack5, typescript, css loader, image loader, config env for dev, prod, react-refresh, eslint, prettier, husky, lint-stage, babel/runtime & bundleAnalyzer