$ git clone https://github.com/mkupriichuk/webpack-template.git .
default master branch // react/typescript/scss with pre-configured mobx,axios,rr-dom
git checkout redux // react/typescript/scss with pre-configured REDUX,axios,rr-dom
git checkout redux-toolkit // react/typescript/scss with pre-configured redux-toolkit,axios,rr-dom
git checkout react // react-sass
git checkout react-css // react-css
git checkout react-ts // react css typescript
git checkout react-scss-ts // react scss typescript
git checkout html // simply html
git checkout pug // pug (deprecated, do not updated anymore)
git checkout nunjucks // nunjucks (deprecated, do not updated anymore)
npm install
yarn install
Server start at http://localhost:3000/
npm run dev
yarn run dev
If you want to use variables from env files, you can create the following files in the root directory:
// single env file
.env
// Different files for development and production mode.
.env.development
.env.production
/**
Please note if you are using .env.development when developing
you should also use .env.production in production
*/
js\ts:
import twitter from './twitter.svg?url'
...
<img src={twitter} alt="twitter" />
or in css:
background-image: url('./twitter.svg')
js\ts:
import Twitter from './twitter.svg'
...
<Twitter />
- Build the app:
$ yarn run build
Or:
$ npm run build
- Do not forget to configure Purify config on ./config/helpers/purify.js
- Now:
$ yarn run purify
Or:
$ npm run purify
- Run server:
$ yarn run server
Or:
$ npm run server
The server will be running on:
localhost:3000
You can modify the server.js in config/server/