Fullstack react-express using typescript + webpack
Use npm
or yarn
to install and run.
npm install
or
rm package-lock.json && yarn
Optional as the post-build should take of building the project.
npm run build
or
yarn build
The
build
script builds the client and server from the TypeScript source code See scripts for more options, including a prod build.
Development:
npm run dev
or
yarn dev
Production:
npm run start
or
yarn start
Expand to see file tree
boilerplate-ts-express/
โโโ src/
โ โโโ client/
โ โ โโโ actions/
โ โ โ โโโ index.ts
โ โ โโโ api/
โ โ โ โโโ client.ts
โ โ โโโ components/
โ โ โ โโโ AddWord.tsx
โ โ โ โโโ App.tsx
โ โ โ โโโ Price.tsx
โ โ โ โโโ Word.tsx
โ โ โ โโโ Words.tsx
โ โ โโโ reducers/
โ โ โ โโโ index.ts
โ โ โ โโโ words.ts
โ โ โโโ index.tsx
โ โ โโโ tsconfig.json
โ โโโ server/
โ โโโ api/
โ โ โโโ coingecko.ts
โ โโโ public/
โ โ โโโ images/
โ โ โ โโโ favicon.ico
โ โ โโโ stylesheets/
โ โ โ โโโ index.scss
โ โ โ โโโ normalize.css
โ โ โโโ index.html/
โ โโโ routes/
โ โ โโโ api.ts
โ โ โโโ index.ts
โ โโโ index.ts
โ โโโ server.ts
โ โโโ tsconfig.json
โโโ package-lock.json
โโโ package.json
โโโ readme.md
โโโ webpack.config.ts
Expand to see scripts
{
"scripts": {
"postinstall": "npm run build",
"start": "node server dist/server/index.js",
"build": "run-p build:client build:server",
"build:watch": "tsc --build ./ --watch",
"build:client": "tsc --build ./src/client",
"build:watch:client": "tsc --build ./src/client --watch",
"build:server": "tsc --build ./src/server",
"build:watch:server": "tsc --build ./src/server --watch",
"dev": "run-p build:watch:client build:watch:server dev:client dev:server",
"dev:client": "npm run webpack -- --watch",
"dev:server": "nodemon --watch server dist/server/index.js",
"webpack:prod": "npm run webpack -- --mode production",
"webpack": "webpack --config ./webpack.config.ts",
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx ./src"
},
}
Expand to see linter details
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"standard",
"prettier"
],
"settings": {
"react": {
"version": "detect"
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"ignorePatterns": [
"./server/bin/www"
],
"rules": {
"no-use-before-define": 0
}
}