ericclemmons / polydev

Faster, route-centric development for Node.js apps with built-in Hot Module Replacement.
282 stars 6 forks source link

create-react-app #5

Open ericclemmons opened 5 years ago

ericclemmons commented 5 years ago

This can be typical of a SPA that lives alongside GraphQL.

I think the right setup is:

Where create-react-app doesn't export a middleware, but just has a package.json.

But what's in `index.*.js`?_

module.exports = require.resolve('cra')

By exporting the path, this means we'll inspect path.resolve(require.resolve('cra'), './package.json') for the following commands:

When getting ready for production:

  1. yarn workspaces run build (which should create all of the static assets)
  2. yarn start
ericclemmons commented 5 years ago

Because of this error:

upath@1.0.4: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.13.0"

(https://github.com/facebook/create-react-app/issues/4367)

I had to run:

yarn config set ignore-engines true
yarn create react-app packages/react-app
ericclemmons commented 5 years ago

Came so close! The problem is create-react-app can't serve assets from a folder besides / in development:

https://github.com/facebook/create-react-app/issues/6135

ericclemmons commented 5 years ago

Waiting on https://github.com/facebook/create-react-app/pull/4158