Skip to content

Vite-based plugin for Hawtio #729

Open
@iMashtak

Description

@iMashtak

Is anyone tried to use Vite to build plugin for Hawtio? I failed with an error:

Uncaught SyntaxError: Cannot use import statement outside a module

vite.config.js:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import federation from "@originjs/vite-plugin-federation";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
    federation({
      name: "project",
      filename: "remoteEntry.js",
      exposes: {
        "./plugin": "./src/project-plugin",
      },
      shared: ["react"],
    }),
  ],
  build: {
    modulePreload: false,
    target: "esnext",
    minify: false,
    cssCodeSplit: false,
  },
})

I've found the exact line where error occures: core.ts. I thought that module federation do not depend on build tool, but i am certanly not sure:(


CRACO build lasts over 3 minutes on my machine compared to 30 sec with Vite, so i very interested in Vite:)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status

      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions