Skip to content

Commit 27c2779

Browse files
committed
Update example
1 parent 23579cc commit 27c2779

File tree

7 files changed

+6
-15
lines changed

7 files changed

+6
-15
lines changed
File renamed without changes.
File renamed without changes.

example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Highlight Strings
1+
# Highlight Numbers
22

3-
A simple example of using `reactReplaceString` to highlight numbers in a rendered text string.
3+
A very simple example of using `reactReplaceString` to highlight numbers in a rendered text string.
44

55
**Quick Start:**
66

example/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const HighlightNumbers = React.createClass({
1010
render() {
1111
return (
1212
<div>
13+
<h1>Highlight Numbers</h1>
1314
{reactReplaceString(this.props.content, /(\d+)/g, (match, i) => (
1415
<span key={i} style={{ color: 'red' }}>{match}</span>
1516
))}

example/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
"devDependencies": {
1212
"babel": "^5.8.34",
1313
"babel-core": "^5.4.7",
14-
"babel-eslint": "^4.1.6",
1514
"babel-loader": "^5.1.2",
16-
"babel-plugin-react-transform": "^1.1.1",
1715
"express": "^4.13.3",
1816
"react": "^0.14.3",
1917
"react-dom": "^0.14.3",
@@ -23,7 +21,6 @@
2321
"redbox-react": "^1.2.0",
2422
"webpack": "^1.12.9",
2523
"webpack-dev-middleware": "^1.4.0",
26-
"webpack-hot-middleware": "^2.6.0",
2724
"react-string-replace": "*"
2825
},
2926
"dependencies": {}

example/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ app.use(require('webpack-dev-middleware')(compiler, {
4848
publicPath: config.output.publicPath,
4949
}));
5050

51-
app.use(require('webpack-hot-middleware')(compiler));
51+
// app.use(require('webpack-hot-middleware')(compiler));
5252

5353
// Send the boilerplate HTML payload down for all get requests. Routing will be
5454
// handled entirely client side and we don't make an effort to pre-render pages

example/webpack.config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable no-var */
1+
/* eslint-disable no-var, prefer-template */
22
var path = require('path');
33
var webpack = require('webpack');
44

@@ -10,16 +10,10 @@ var webpack = require('webpack');
1010
// https://github.com/glenjamin/webpack-hot-middleware/issues/37
1111
var DEV_PORT = process.env.DEV_PORT || 3000;
1212
var DEV_HOST = '//localhost:' + DEV_PORT + '/';
13-
var HMR_HOST = DEV_HOST + '__webpack_hmr';
1413

1514
module.exports = {
16-
devtool: 'inline-source-map',
17-
1815
entry: {
19-
app: [
20-
'webpack-hot-middleware/client?path=' + HMR_HOST,
21-
'./index.js',
22-
],
16+
app: './index.js',
2317
},
2418

2519
output: {
@@ -29,7 +23,6 @@ module.exports = {
2923
},
3024

3125
plugins: [
32-
new webpack.HotModuleReplacementPlugin(),
3326
new webpack.NoErrorsPlugin(),
3427
],
3528

0 commit comments

Comments
 (0)