mirror of
https://github.com/react-webpack-generators/generator-react-webpack.git
synced 2025-12-08 18:01:59 +00:00
Add and use Hot Module Replacement plugin and react-hot-loader
This commit is contained in:
parent
3eca7c6f7c
commit
43f7dbffdc
@ -27,6 +27,7 @@ module.exports = function (grunt) {
|
|||||||
|
|
||||||
'webpack-dev-server': {
|
'webpack-dev-server': {
|
||||||
options: {
|
options: {
|
||||||
|
hot: true,
|
||||||
port: 8000,
|
port: 8000,
|
||||||
webpack: webpackDevConfig,
|
webpack: webpackDevConfig,
|
||||||
publicPath: '/assets/',
|
publicPath: '/assets/',
|
||||||
|
|||||||
@ -11,7 +11,8 @@
|
|||||||
"mainOutput": "main",
|
"mainOutput": "main",
|
||||||
"dependencies": {<% if (reactRouter) { %>
|
"dependencies": {<% if (reactRouter) { %>
|
||||||
"react-router": "^0.7.0",<% } %>
|
"react-router": "^0.7.0",<% } %>
|
||||||
"react": "~0.11.2"
|
"react": "~0.11.2",
|
||||||
|
"react-hot-loader": "^0.4.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "~0.4.5",
|
"grunt": "~0.4.5",
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var webpack = require('webpack');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
@ -17,7 +18,10 @@ module.exports = {
|
|||||||
cache: true,
|
cache: true,
|
||||||
debug: true,
|
debug: true,
|
||||||
devtool: false,
|
devtool: false,
|
||||||
entry: './src/scripts/components/<%= pkg.mainInput %>.jsx',
|
entry: [
|
||||||
|
'webpack/hot/dev-server',
|
||||||
|
'./src/scripts/components/<%= pkg.mainInput %>.jsx'
|
||||||
|
],
|
||||||
|
|
||||||
stats: {
|
stats: {
|
||||||
colors: true,
|
colors: true,
|
||||||
@ -37,7 +41,7 @@ module.exports = {
|
|||||||
|
|
||||||
loaders: [{
|
loaders: [{
|
||||||
test: /\.jsx$/,
|
test: /\.jsx$/,
|
||||||
loader: 'jsx-loader?harmony'
|
loader: 'react-hot!jsx-loader?harmony'
|
||||||
}, {
|
}, {
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
loader: 'style-loader!css-loader'
|
loader: 'style-loader!css-loader'
|
||||||
@ -45,6 +49,10 @@ module.exports = {
|
|||||||
test: /\.(png|jpg)$/,
|
test: /\.(png|jpg)$/,
|
||||||
loader: 'url-loader?limit=8192'
|
loader: 'url-loader?limit=8192'
|
||||||
}]
|
}]
|
||||||
}
|
},
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
new webpack.HotModuleReplacementPlugin()
|
||||||
|
]
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user