This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
forked from gaearon/react-transform-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated project to react-hot-loader 3.0-alpha12 This closes #1
- Loading branch information
Showing
16 changed files
with
100 additions
and
2,323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
{ | ||
"presets": [ | ||
"react", | ||
"es2015" | ||
"presets": [ | ||
"es2015", | ||
"stage-0", | ||
"react" | ||
], | ||
"env": { | ||
"development": { | ||
"presets": [ | ||
"react-hmre" | ||
] | ||
"plugins": ["react-hot-loader/babel"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,19 @@ | ||
/*eslint no-console: 0*/ | ||
const path = require('path'); | ||
const express = require('express'); | ||
const webpack = require('webpack'); | ||
const WebpackDevServer = require('webpack-dev-server'); | ||
const config = require('./webpack.config.dev'); | ||
|
||
const app = express(); | ||
const compiler = webpack(config); | ||
new WebpackDevServer(webpack(config), { | ||
publicPath: config.output.publicPath, | ||
hot: true, | ||
historyApiFallback: true, | ||
stats: { | ||
colors: true | ||
} | ||
}).listen(3000, 'localhost', function (err) { | ||
if (err) { | ||
console.log(err); | ||
} | ||
|
||
app.use(require('webpack-dev-middleware')(compiler, { | ||
noInfo: true, | ||
publicPath: config.output.publicPath | ||
})); | ||
|
||
app.use(require('webpack-hot-middleware')(compiler)); | ||
|
||
app.get('*', function(req, res) { | ||
res.sendFile(path.join(__dirname, 'index.html')); | ||
}); | ||
|
||
app.listen(3000, 'localhost', function(err) { | ||
if (err) { | ||
console.log(err); | ||
return; | ||
} | ||
console.log('Listening at http://localhost:3000'); | ||
console.log('Listening at localhost:3000'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import { AppContainer } from 'react-hot-loader'; | ||
import App from './App'; | ||
|
||
render(<App />, document.getElementById('root')); | ||
render( | ||
<AppContainer | ||
component={App} | ||
/>, | ||
document.getElementById('root') | ||
); | ||
|
||
if (module.hot) { | ||
module.hot.accept('./App', () => { | ||
render( | ||
<AppContainer | ||
component={require('./App').default} | ||
/>, | ||
document.getElementById('root') | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
{ | ||
"ambientDependencies": { | ||
"express": "registry:dt/express#4.0.0+20160317120654", | ||
"express-serve-static-core": "registry:dt/express-serve-static-core#0.0.0+20160317120654", | ||
"lodash": "registry:dt/lodash#3.10.0+20160330154726", | ||
"node": "registry:dt/node#4.0.0+20160317120654", | ||
"react": "registry:dt/react#0.14.0+20160316155526", | ||
"webpack": "registry:dt/webpack#1.12.9+20160316155526" | ||
"react": "registry:dt/react#0.14.0+20160423065914", | ||
"webpack": "registry:dt/webpack#1.12.9+20160321060707" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/// <reference path="browser/ambient/lodash/index.d.ts" /> | ||
/// <reference path="browser/ambient/react/index.d.ts" /> | ||
/// <reference path="browser/ambient/webpack/index.d.ts" /> |
Oops, something went wrong.