jarvelov / vue-form-json-schema

Create forms using JSON schema. Bring your components!
https://jarvelov.gitbook.io/vue-form-json-schema/
353 stars 53 forks source link

problem with starting #118

Open hironaokato opened 3 years ago

hironaokato commented 3 years ago

Hello there, I'm using Vite , Vue3 and Element UI written under Composition API style.

I followed the installation and my code is just copy and pasted from the Usage Page, but browser didn't start.

Do you have any idea what I can do with? Or if there is anything I should do with, please let me know ;)

EDIT: sry I used the V2.8.x but I switched to the V3.0.0 alpha, and it did go well. Should I switch to vue3rewrite branch?

michaelmok2021 commented 2 years ago

@hironaokato any chance you can share your vite.config.js. We are not able to get the vue-form-json-schema to work after compilig with vite. Note we are using vue 2.6.14 and bootstap.

Our vite.config.js looks like this.

import path from "path";
import { defineConfig } from "vite";
import { createVuePlugin } from "vite-plugin-vue2";
import WindiCSS from "vite-plugin-windicss";
import Components from "unplugin-vue-components/vite";
import Icons from "unplugin-icons/vite";
import IconsResolver from "unplugin-icons/resolver";

// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) =>
  ({
      resolve: {
          alias: {
              "@": `${path.resolve(__dirname, "src")}`,
          },
          dedupe: ["vue-demi"],
      },
      plugins: [
          createVuePlugin(),
          WindiCSS(),
          Components({
              resolvers: [
                  IconsResolver({
                      componentPrefix: "",
                  }),
              ],
          }),
          Icons(),
      ],
      optimizeDeps: {
          exclude: ['vue-demi']
      },
      build: {
        brotliSize: false,
        manifest: false,
        minify: mode === 'development' ? false : 'terser',
        outDir: 'dist',
        sourcemap: command === 'serve' ? 'inline' : false,
      }
  })
)

Thanks