Skip to content

AWS Amplify

Sokichi Fujita edited this page May 11, 2020 · 7 revisions

How to add AWS Amplify to Starter-React-Flux

Installation

  1. Install Amplify modules.
npm install --save aws-amplify aws-amplify-react

Install style-loader abd css-loader for aws-amplify-react which is React components of AWS Amplify.

npm install --save-dev style-loader css-loader 

Configure

  1. Add configuration of style-loader and css-loader which are used in aws-amplify-react.
  module: {
    rules: [
      {
        test: /.(ts|tsx|js|jsx)$/,
        exclude: [path.resolve(__dirname, "node_modules")],
        loader: "babel-loader"
      },
      {
        test: /\.css$/,
        use: ["style-loader", "css-loader"] //Please use this order.
      }
    ]
  },

For AWS AppSync (GraphQL)

  • Currently amplify-cli has a bug of the GraphQL code generation. Please rename the directory app with src and related configuration of package.json and webpack.common.js.
Clone this wiki locally