Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Hot Loader 3.0 beta demo #61

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c423415
React Hot Loader 3.0 demo
gaearon Apr 17, 2016
5d5175b
Use Babel
gaearon Apr 18, 2016
afa4aee
Bump version!
gaearon Apr 18, 2016
691fe11
Bump version
gaearon Apr 18, 2016
7f8903b
Bump the version
gaearon Apr 28, 2016
b52c727
Bump to 3.0.0-beta.0
gaearon Apr 30, 2016
f134ff3
Bump version
gaearon May 2, 2016
febf956
changed the regex expression to handle .jsx files (#83)
gfantom Nov 1, 2016
dfeb37b
Use webpack middleware
bradleyboy May 20, 2016
f764530
Add express, remove webpack dev server
bradleyboy May 20, 2016
5c76efd
Formatting
bradleyboy May 20, 2016
372080f
update dependencies and add yarn.lock
calesce Nov 3, 2016
a26a653
add OccurrenceOrder and NoErrors webpack plugins
calesce Nov 20, 2016
9089b6b
use cheap-module-eval-source-map option for source maps
calesce Nov 20, 2016
9609a8e
use cheap-module-source-map
calesce Nov 21, 2016
437dc6a
Updated dependencies
petertrotman Jan 25, 2017
314c024
Updated .babelrc and webpack.config.js
petertrotman Jan 25, 2017
6811627
Updated
petertrotman Jan 25, 2017
19d3594
Resolved inconsistencies with webpack's guide setup and original boil…
petertrotman Jan 25, 2017
59281e4
Readded yarn.lock file with updated dependencies
petertrotman Jan 25, 2017
abe4763
Updated README with citation to webpack guide and removed reference t…
petertrotman Jan 25, 2017
c78530f
removed .jshintrc
calesce Jan 25, 2017
26938f2
update license and fix some formatting
calesce Jan 25, 2017
43f80ee
Readded eslint and updated yarn.lock
petertrotman Jan 26, 2017
d6891f2
Fixed missing eslint dependency and updated yarn.lock file
petertrotman Jan 26, 2017
92cb506
Merge branch 'next' into next
calesce Jan 26, 2017
8a05c0d
Merge pull request #111 from petertrotman/next
calesce Jan 26, 2017
949277a
document known WebStorm file-watching issue
calesce Jan 26, 2017
677a4d6
Ensure initial render
petertrotman Jan 26, 2017
a2d489d
Add basic build script
cookpete Feb 20, 2017
530fb8f
update yarn.lock
calesce Feb 26, 2017
8ebffda
update README
vikr01 Oct 5, 2018
4e51cf7
Merge pull request #141 from vikr01/next
theKashey Oct 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -24,13 +24,21 @@ This boilerplate project includes React-friendly ESLint configuration.
npm run lint
```

### Building

A basic production script is included that builds your app to a `dist` folder

```
npm run build
```

### Using `0.0.0.0` as Host

You may want to change the host in `webpack.config.js` from `localhost` to `0.0.0.0` to allow access from same WiFi network. This is not enabled by default because it is reported to cause problems on Windows. This may also be useful if you're using a VM.

### Missing Features

This boilerplate is purposefully simple to show the minimal configuration for React Hot Loader. For a real project, you'll want to add a separate config for production with hot reloading disabled and minification enabled. You'll also want to add a router, styles and maybe combine dev server with an existing server. This is out of scope of this boilerplate, but you may want to look into [other starter kits](https://github.com/gaearon/react-hot-loader/blob/master/docs/README.md#starter-kits).
This boilerplate is purposefully simple to show the minimal configuration for React Hot Loader. For a real project, you may want to add a router, styles and maybe combine dev server with an existing server. This is out of scope of this boilerplate, but you may want to look into [other starter kits](https://github.com/gaearon/react-hot-loader/blob/master/docs/README.md#starter-kits).

### WebStorm

Expand Down
8 changes: 7 additions & 1 deletion package.json
Expand Up @@ -4,7 +4,10 @@
"description": "Boilerplate for ReactJS project with hot code reloading",
"scripts": {
"start": "webpack-dev-server",
"lint": "eslint src"
"lint": "eslint src",
"prebuild": "rimraf dist",
"build": "cross-env NODE_ENV=production webpack -p --config webpack.config.production.js",
"postbuild": "copyfiles index.html dist"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,7 +36,10 @@
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-2": "^6.22.0",
"copyfiles": "^1.2.0",
"cross-env": "^3.1.4",
"react-hot-loader": "^3.0.0-beta.6",
"rimraf": "^2.6.0",
"webpack": "^2.2.0",
"webpack-dev-server": "^2.2.0"
},
Expand Down
33 changes: 33 additions & 0 deletions webpack.config.production.js
@@ -0,0 +1,33 @@
var path = require('path');
var webpack = require('webpack');

module.exports = {
entry: './src/index.js',

output: {
filename: 'static/bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
},

devtool: 'source-map',

module: {
rules: [
{
test: /\.jsx?$/,
use: [
'babel-loader'
],
exclude: /node_modules/
}
]
},

plugins: [
new webpack.optimize.UglifyJsPlugin({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant since webpack -p will process output via uglify without the plugin configured.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sourceMap: true,
comments: false
})
]
};