npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lark-apaas/fullstack-vite-preset

v1.0.20

Published

Vite preset for Fullstack applications, providing a complete replacement for `@lark-apaas/fullstack-rspack-preset`.

Readme

@lark-apaas/fullstack-vite-preset

Vite preset for Fullstack applications, providing a complete replacement for @lark-apaas/fullstack-rspack-preset.

Installation

npm install @lark-apaas/fullstack-vite-preset vite

Usage

Basic Usage

Create a vite.config.ts file in your project root:

import path from 'path';
import { defineConfig } from '@lark-apaas/fullstack-vite-preset';

export default defineConfig({
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'client/src'),
    },
  },
});

Environment Variables

The preset automatically reads the following environment variables:

| Variable | Description | Default | |----------|-------------|---------| | NODE_ENV | development | production | development | | NEED_ROUTES | Enable route parsing | true | | CLIENT_BASE_PATH | Client base path | / | | ASSETS_CDN_PATH | Production CDN path | / | | SERVER_PORT | Backend server port | 3000 | | CLIENT_DEV_PORT | Vite dev server port | 8080 | | CLIENT_DEV_HOST | Vite dev server host | localhost | | LOG_DIR | Log directory | ./logs |

Scripts

Update your package.json scripts:

{
  "scripts": {
    "dev:client": "vite --config vite.config.ts",
    "build:client": "vite build --config vite.config.ts",
    "preview:client": "vite preview --config vite.config.ts"
  }
}

Features

Included Plugins

  • React Plugin: With automatic JSX runtime and styled-jsx support via Babel
  • Route Parser Plugin: Automatically parses React Router routes from app.tsx
  • Slardar Plugin: Injects performance monitoring SDK
  • View Context Plugin: Injects server-side context variables
  • OG Meta Plugin: Injects Open Graph meta tags
  • Module Alias Plugin: Provides enhanced clsx (with tailwind-merge) and echarts (with theme)
  • HMR Timing Plugin: Tracks and reports HMR compilation metrics

Module Aliases

The preset automatically replaces:

  • clsx - Enhanced with tailwind-merge for automatic Tailwind class deduplication
  • echarts - Pre-configured with a shadcn-compatible theme (ud)

Dev Server Features

  • Proxy configuration for /api and /__innerapi__ routes
  • HTML requests proxied to backend server
  • SnapDom proxy middleware for debugging
  • Dev logs and OpenAPI middleware integration

Build Features

  • Source maps in development
  • Terser minification in production
  • Code splitting enabled (Vite default)
  • PostCSS with postcss-import plugin

HTML Template

Ensure your client/index.html uses ES module scripts:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Fullstack App</title>
</head>
<body>
  <div id="root"></div>
  <script type="module" src="/client/src/index.tsx"></script>
</body>
</html>

Migration from Rspack Preset

  1. Replace @lark-apaas/fullstack-rspack-preset with @lark-apaas/fullstack-vite-preset
  2. Rename rspack.config.js to vite.config.ts
  3. Update the config to use the new defineConfig function
  4. Update client/index.html to use type="module" for scripts
  5. Update package.json scripts to use vite instead of rspack

License

MIT