Ensono / Amido.Ecommerce.UI.Federated

Federated Modules Production Grade boilerplate for Next
MIT License
2 stars 0 forks source link

Create dev script and attach to Nodemon #64

Closed AlzAmido closed 2 years ago

AlzAmido commented 2 years ago

Currently the application only builds for production (through npm run build) and serves the production runtime (npm run serve) what we need is a script that will build and serve in development mode so that we can attach nodemon to it and have it rebuild and execute every time we change source code. this will enhance the development experience and boost productivity whilst making sure that we can run the application in development mode (currently not possible)

there is already a script/start.js file in the AppShell which is supposed to do exactly that. the issue is that this uses WebpackDevServer which I don't think it's suitable because that is commonly used cor CSR apps whilst ours is SSR. the culprit is as follows: 1) build in development mode (client and server) 2) output the build in a /dist folder (as opposed to /build for production) so we can keep things separated (there is already a configuration in webpack for this) 3) start the server (bundled as server.js in the dist folder now) in development mode (you will probably need cross-env) 4) provide nodemon to run the script in the first place

velvetkevorkian commented 2 years ago

app shell and MFEs all have dev scripts with Nodemon attached, closing this.