Skip to content

Build fails with vite-ssg #12

@praburangki

Description

@praburangki

I've encountered an error while building, I thought there was something wrong with my configuration then I tried to reproduce using https://github.com/antfu/vitesse.

I've tried using this two approach:

  1. content of main.ts:
import 'virtual:windi.css'
import './styles/main.css'
import { ViteSSG } from 'vite-ssg'
import generatedRoutes from 'virtual:generated-pages'
import { setupLayouts } from 'layouts-generated'
import { MotionPlugin } from '@vueuse/motion'
import App from './App.vue'

const routes = setupLayouts(generatedRoutes)

// https://github.com/antfu/vite-ssg
export const createApp = ViteSSG(
  App,
  { routes },
  (ctx) => {
    ctx.app.use(MotionPlugin)
    // install all modules under `modules/`
    Object.values(import.meta.globEager('./modules/*.ts')).map(i => i.install?.(ctx))
  },
)
  1. Using the module
import { MotionPlugin } from '@vueuse/motion';
import { UserModule } from '~/types';

export const install: UserModule = ({ app, isClient }) => {
  isClient && app.use(MotionPlugin);
};

The build script:
cross-env NODE_ENV=production vite-ssg build

and the result of the build returns the message:
image

What am I missing here? thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions