Automattic / wp-api-console

WordPress (.com and .org) API Console written in React/Redux
GNU General Public License v2.0
70 stars 20 forks source link

Update Create React App #61

Closed youknowriad closed 7 years ago

youknowriad commented 7 years ago

In order to deploy the console, we need relative paths and this is possible with the last CRA release I also added the default prod config

nylen commented 7 years ago

I pushed a change to detect the babel loader at any position in the loaders array of the production webpack config. We can use [].find here because it is supported from Node 4.x, and create-react-app requires at least Node 4.x also.

nylen commented 7 years ago

Another question: it looks like we need to copy config.prod.json to config.json before doing a production deploy. Is this correct? Probably fine for now, but can you think of a better way to handle it in the future?

nylen commented 7 years ago

I think the build script is looking better, but the thing I tried with process.env.CONFIG is not working - we need to tell webpack about this change instead of letting it flow through to the browser.

We also need to switch the config to OAuth2, and then this should be ready to go.