Git Product home page Git Product logo

esausilva / react-starter-boilerplate-hmr Goto Github PK

View Code? Open in Web Editor NEW
184.0 5.0 81.0 1.91 MB

React starter boilerplate with React Fast Refresh, React 17 and Webpack 5

Home Page: https://esausilva.com/2018/01/13/learn-webpack-for-react/

License: MIT License

JavaScript 94.73% HTML 3.90% CSS 1.37%
react boilerplate react-boilerplate semantic-ui-react semantic-ui css-modules code-splitting babel7 react-router-v5 webpack5

react-starter-boilerplate-hmr's Introduction

react-starter-boilerplate-hmr

React Starter Boilerplate with React Fast Refresh and Webpack 5

Tutorial

The tutorial on my blog site is the most up-to-date with this template. Visit my blog entry where I go step-by-step on how to build this boilerplate from scratch.

Features

  • React 17
  • React Fast Refresh
  • React Router 5
  • Webpack 5
  • Semantic UI as the CSS Framework
  • CSS Autoprefixer
  • CSS Modules with SourceMap
  • @babel/plugin-proposal-class-properties
  • @babel/plugin-syntax-dynamic-import
  • Code splitting by Route and Vendor
  • Webpack Bundle Analyzer
  • Take a look at package.json

Usage

Install dependencies

$ yarn

Run development server

$ yarn dev

Building

$ yarn build

Will create a dist directory containing your compiled code.

Depending on your needs, you might want to do more optimization to the production build.

Webpack Bundle Analyzer

Run in development

$ yarn dev:bundleanalyzer

Run on the production oprimized build

$ yarn build:bundleanalyzer

Giving Back

If you would like to support my work and the time I put into making tutorials, consider getting me a coffee by clicking on the image below. I would really appreciate it!

Buy Me A Coffee

-Esau Silva

react-starter-boilerplate-hmr's People

Contributors

7anshuai avatar dependabot[bot] avatar esausilva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-starter-boilerplate-hmr's Issues

WARNING in entrypoint size limit, Entrypoint undefined = index.html

yarn build yarn run v1.3.2 $ rimraf dist $ cross-env NODE_ENV=production webpack -p --env.env=prod **(node:30669) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks` instead**
(node:30669) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
Hash: ef4be58bb97e7c02b221
Version: webpack 4.0.1
Time: 16326ms
Built at: 3/12/2018 10:56:18 PM
Asset Size Chunks Chunk Names
static/DynamicPage.ef4be58bb97e7c02b221.js.map 810 bytes 1 [emitted] DynamicPage
static/NoMatch.ef4be58bb97e7c02b221.js 361 bytes 0 [emitted] NoMatch
static/app.ef4be58bb97e7c02b221.js 56.8 KiB 2 [emitted] app
static/vendor.ef4be58bb97e7c02b221.js 363 KiB 3 [emitted] [big] vendor
styles/styles.d41d8cd98f00b204e9800998ecf8427e.css 71 bytes 3 [emitted] vendor
styles/styles.cc403e05dca835cff7c748e8c7fd6051.css 250 bytes 2 [emitted] app
static/NoMatch.ef4be58bb97e7c02b221.js.map 797 bytes 0 [emitted] NoMatch
static/DynamicPage.ef4be58bb97e7c02b221.js 377 bytes 1 [emitted] DynamicPage
static/app.ef4be58bb97e7c02b221.js.map 233 KiB 2 [emitted] app
styles/styles.cc403e05dca835cff7c748e8c7fd6051.css.map 467 bytes 2 [emitted] app
static/vendor.ef4be58bb97e7c02b221.js.map 1.57 MiB 3 [emitted] vendor
styles/styles.d41d8cd98f00b204e9800998ecf8427e.css.map 127 bytes 3 [emitted] vendor
favicon.ico 24.3 KiB [emitted]
index.html 784 bytes [emitted]
Entrypoint app [big] = static/vendor.ef4be58bb97e7c02b221.js styles/styles.d41d8cd98f00b204e9800998ecf8427e.css static/vendor.ef4be58bb97e7c02b221.js.map styles/styles.d41d8cd98f00b204e9800998ecf8427e.css.map static/app.ef4be58bb97e7c02b221.js styles/styles.cc403e05dca835cff7c748e8c7fd6051.css static/app.ef4be58bb97e7c02b221.js.map styles/styles.cc403e05dca835cff7c748e8c7fd6051.css.map
[13] ./node_modules/semantic-ui-react/dist/es/index.js + 223 modules 619 KiB {3} [built]
| 224 modules
[39] ./node_modules/react-router-dom/es/index.js + 30 modules 75.7 KiB {2} [built]
| 31 modules
[143] (webpack)/buildin/module.js 519 bytes {3} [built]
[152] (webpack)/buildin/global.js 509 bytes {3} [built]
[294] ./src/index.js + 5 modules 4.83 KiB {2} [built]
| ./src/index.js 476 bytes [built]
| + 5 hidden modules
[295] ./src/index.css 41 bytes {2} [built]
[307] multi ./src/index.js 28 bytes {2} [built]
[518] multi semantic-ui-react 28 bytes {3} [built]
+ 511 hidden modules

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.

Assets:
static/vendor.ef4be58bb97e7c02b221.js (363 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
app (420 KiB)
static/vendor.ef4be58bb97e7c02b221.js
styles/styles.d41d8cd98f00b204e9800998ecf8427e.css
static/app.ef4be58bb97e7c02b221.js
styles/styles.cc403e05dca835cff7c748e8c7fd6051.css

Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = index.html
[0] (webpack)/buildin/module.js 519 bytes {0} [built]
[1] (webpack)/buildin/global.js 509 bytes {0} [built]
[3] ./node_modules/html-webpack-plugin/lib/loader.js!./public/index.html 811 bytes {0} [built]
+ 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--5-2!node_modules/postcss-loader/lib/index.js??ref--5-3!src/index.css:
Entrypoint undefined = extract-text-webpack-plugin-output-filename
[1] ./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/lib??ref--5-3!./src/index.css 246 bytes {0} [built]
+ 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--5-2!node_modules/postcss-loader/lib/index.js??ref--5-3!src/components/layout.css:
Entrypoint undefined = extract-text-webpack-plugin-output-filename
2 modules
Done in 23.66s.
`

To deploy on server

Hi Mate,

I have been using this starter. Now i am going to host on my server. When i have build it will create file inside of Dist folder. But it will not open as normal so is there any idea , please can you help?

script dev

How about change like this,

webpack-dev-server --env.env=dev --port 8080 --hot --host 0.0.0.0

it works my environment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.