Skip to content

patricktran/zero-one-react-app-rewired

 
 

Repository files navigation

NPM

ℹ️ This repo is a fork of https://github.com/timarney/react-app-rewired. It supports async/await for the devServer configuration. See test/react-app.

Pending PR: timarney#543

module.exports = {
  // The Webpack config to use when compiling your react app for development or production.
  webpack: function(config, env) {
    // ...add your webpack config
    return config;
  },
  // The function to use to create a webpack dev server configuration when running the development
  // server with 'npm run start' or 'yarn start'.
  devServer: async configFunction => {

    //call your awaitable methods here
    const result = await Promise.resolve('do something async');
    console.log(result);

    return (proxy, allowedHost) => {
      const config = configFunction(proxy, allowedHost);
      //do something with the result 
      return config;
    }
  }
}

About

Support async await for devServer configuration. Override create-react-app webpack configs without ejecting

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 83.4%
  • HTML 10.8%
  • CSS 5.8%