🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

vite-plugin-ssg-utils

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-ssg-utils

Utils for vite-ssg and other Vite SSG or SSR tools.

2.0.16
latest
Source
npm
Version published
Maintainers
1
Created
Source

vite-plugin-ssg-utils

Utils for vite-ssg and other Vite SSG or SSR tools.

npm

Features

  • Mocking of ResizeObserver for SSR and SSG builds

Installation

yarn add -D vite-plugin-ssg-utils

Usage

The plugin will only be applied when the build command is used and config.build.ssr is truthy. This is the case when using tools like vite-ssg.

import { defineConfig } from 'vite'

import SSGUtils from 'vite-plugin-ssg-utils'

export default defineConfig({
  plugins: [
    // The options are not required.
    // Default values are used in the following example.
    SSGUtils({
      resizeObserver: true,
    }),
    // ...other plugins
  ],
  // ...remaining config
})

Options

Optionally, the plugin can be configured with the following options.

resizeObserver

ValueDescription
true (default)Mock ResizeObserver using a dummy class
falseDo not mock ResizeObserver
new () => ResizeObserverMock ResizeObserver with a custom class

Keywords

vite-plugin

FAQs

Package last updated on 28 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts