Skip to content

hfl0506/google-map-experiment

Repository files navigation

Location Project

  • related technologies:
  • related api:

How to run locally

API

  1. Create a .env file which copy from .env.example, input your key first
  2. Run yarn or npm installto install deps
  3. Run yarn dev or npm run dev to start server
  4. Go to localhost:3000

Deploy notes:

add this code in index.html

<script>
      var global = global || window;
      var Buffer = Buffer || [];
      var process = process || { env: { DEBUG: undefined }, version: [] };
</script>

add this code in main.js / main.ts

import { Amplify } from "aws-amplify";

Amplify.configure({});

add this code in vite.config.js

import resolve from "@rollup/plugin-node-resolve";
import { visualizer } from "rollup-plugin-visualizer";

export default ({ mode }) => {
  ...,
  return defineConfig({
    plugins: [
      react(),
      {
        ...resolve({
          preferBuiltins: false,
          browser: true,
        }),
        enforce: "pre",
        apply: "build",
      },
      visualizer(),
    ],
    define: {...},
  });
};

Last, look carefully into the yaml file at amplify, especially in the yaml file of baseDir path