You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.
I'm trying to wrap all of react-engine and my small react app in a module that can easily be used in another larger express app for example if you export the app variable at the end of this file example/server.js and rename that file react-code.js then make another file server.js with something like this:
importreactCodefrom'./react-code'importexpressfrom'express';letapp=express();app.use(reactCode)constPORT=3000;constserver=app.listen(PORT,function(){console.log('Example app listening at http://localhost:%s',PORT);});
I can easily move around the react piece in a larger express app (ignore that theres a * glob assigned to every route in the example).
The thing I'm having a more hard time including in this modularity is the webpack integration. I was wondering if it was possible to use webpack programmatically and given env flags a piece of middleware could render .bundle.js and serve it directly from express instead of having webpack render a file in a specific public folder. The fixed public folder, and the webpack script prevents a react-engine route / express app from being easily encapsulated.
Wondering general thoughts on this. I'm trying to compartmentalize / organize the react-engine-app portion of a greater app, without too much overhead on integrating webpack.
/packages
/react-engine-app
/app.js
The text was updated successfully, but these errors were encountered:
reggi
changed the title
Encapsulation
Bringing react engine in existing express app.
Feb 4, 2016
I'm trying to wrap all of
react-engine
and my small react app in a module that can easily be used in another larger express app for example if you export the app variable at the end of this file example/server.js and rename that filereact-code.js
then make another fileserver.js
with something like this:I can easily move around the react piece in a larger express app (ignore that theres a * glob assigned to every route in the example).
The thing I'm having a more hard time including in this modularity is the webpack integration. I was wondering if it was possible to use webpack programmatically and given
env
flags a piece of middleware could render.bundle.js
and serve it directly from express instead of having webpack render a file in a specific public folder. The fixed public folder, and the webpack script prevents areact-engine
route / express app from being easily encapsulated.Wondering general thoughts on this. I'm trying to compartmentalize / organize the
react-engine-app
portion of a greater app, without too much overhead on integrating webpack.The text was updated successfully, but these errors were encountered: