Skip to content

Commit

Permalink
edit demo12
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed Oct 17, 2015
1 parent bb6aecb commit 10671d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion demo12/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ http.createServer(function (req, res) {
res.end(html);
} else if (req.url == '/bundle.js') {
res.setHeader('Content-Type', 'text/javascript');
browserify().add('./browser.js').transform(literalify.configure({ react: 'window.React' })).bundle().pipe(res);
browserify().add('./browser.js').transform(literalify.configure({
'react': 'window.React',
'react-dom': 'window.ReactDOM'
})).bundle().pipe(res);
} else {
res.statusCode = 404;
res.end();
Expand Down
5 changes: 4 additions & 1 deletion demo12/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ http.createServer(function(req, res) {
res.setHeader('Content-Type', 'text/javascript');
browserify()
.add('./browser.js')
.transform(literalify.configure({react: 'window.React'}))
.transform(literalify.configure({
'react': 'window.React',
'react-dom': 'window.ReactDOM',
}))
.bundle()
.pipe(res);
} else {
Expand Down

0 comments on commit 10671d5

Please sign in to comment.