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

@atomazing-org/vite-config

v0.2.11

Published

A library providing a vite configuration with including PWA and MF supports.

Readme

@atomazing-org/vite-config

@atomazing-org/vite-config is a Vite configuration toolkit for React applications. It provides a single createViteConfig entry point with practical defaults and optional integrations.

Features

  • React setup (@vitejs/plugin-react) with Emotion support
  • TypeScript diagnostics in dev (vite-plugin-checker)
  • Module Federation support (@module-federation/vite)
  • PWA support (vite-plugin-pwa) with optional QR in dev
  • Optional HTTPS in dev (@vitejs/plugin-basic-ssl)
  • Optional i18n integration (@lingui/vite-plugin)
  • Shared TypeScript config export (configs/tsconfig.json)

Installation

# npm
npm install @atomazing-org/vite-config

# yarn
yarn add @atomazing-org/vite-config

# pnpm
pnpm add @atomazing-org/vite-config

Install From Scratch

Requirements:

  • Node.js >=20
  • pnpm (recommended), npm, or yarn

Option A: Use the library in a brand new app

  1. Create a Vite React app:
pnpm create vite my-app --template react-ts
cd my-app
  1. Install project dependencies:
pnpm install
  1. Add @atomazing-org/vite-config:
pnpm add @atomazing-org/vite-config
  1. Replace vite.config.ts:
import { createViteConfig } from '@atomazing-org/vite-config'

export default createViteConfig({
	server: {
		port: 5173,
	},
})
  1. Extend package TS config in tsconfig.json:
{
	"extends": "@atomazing-org/vite-config/configs/tsconfig.json"
}
  1. Run the app:
pnpm dev

Option B: Set up this repository for local development

  1. Clone and enter the repo:
git clone https://github.com/atomazing/vite-config.git
cd vite-config
  1. Install dependencies:
pnpm install
  1. Build the library:
pnpm build
  1. Validate examples:
pnpm check:examples
pnpm check:examples:smoke
  1. Run examples manually (optional):
pnpm --dir examples/basic dev
pnpm --dir examples/microfrontends/remote dev
pnpm --dir examples/microfrontends/host dev

Quick Start

Create vite.config.ts:

import { createViteConfig } from '@atomazing-org/vite-config'

export default createViteConfig({
	server: {
		port: 5173,
	},
})

Configuration API

createViteConfig accepts all regular Vite UserConfig options plus:

  • enableDevPwa?: boolean
    Enable PWA dev mode and QR plugin behavior.
  • enableHttps?: boolean
    Enable self-signed HTTPS in development.
  • enableI8n?: boolean
    Enable Lingui integration.
  • checkTypescript?: boolean
    Enable/disable TypeScript checks in dev (true by default).
  • moduleFederationOptions?: Partial<ModuleFederationOptions> & Pick<ModuleFederationOptions, 'name'>
    Module Federation setup for host/remote apps.
  • reactPluginOptions?: ReactPluginOptions
    Additional options forwarded to @vitejs/plugin-react.

Usage Examples

Basic

import { createViteConfig } from '@atomazing-org/vite-config'

export default createViteConfig({
	server: {
		port: 5173,
	},
})

Module Federation Host

import { createViteConfig } from '@atomazing-org/vite-config'

export default createViteConfig({
	moduleFederationOptions: {
		name: 'host',
		remotes: {
			remote: 'remote@https://example.com/remoteEntry.js',
		},
		shared: {
			react: { singleton: true },
			'react-dom': { singleton: true },
		},
	},
})

Module Federation Remote

import { createViteConfig } from '@atomazing-org/vite-config'

export default createViteConfig({
	moduleFederationOptions: {
		name: 'remote',
		exposes: {
			'./mount': './src/mount.tsx',
		},
	},
})

PWA Manifest and Workbox

Generate manifest.ts:

npx @atomazing-org/vite-config create-manifest

You can also provide your own workbox.config.ts. If it is not found, the default Workbox config from this package is used.

TypeScript Setup

Extend the shared config in your project:

{
	"extends": "@atomazing-org/vite-config/configs/tsconfig.json"
}

Re-Exports

In addition to createViteConfig, the package re-exports:

  • workbox-build
  • workbox-window
  • vite-plugin-pwa

Notes

  • PWA QR output in dev appears only when enableDevPwa: true.
  • HTTPS is enabled via @vitejs/plugin-basic-ssl when enableHttps: true.
  • Config initialization logs are grouped by feature to simplify diagnostics.

Examples

Interactive examples are available in examples/:

  • examples/basic - baseline createViteConfig usage and feature overview.
  • examples/microfrontends/remote - Module Federation remote exposing ./mount.
  • examples/microfrontends/host - Module Federation host loading remote/mount.

Start from:

pnpm --dir examples/basic dev

Microfrontends run order:

pnpm --dir examples/microfrontends/remote dev
pnpm --dir examples/microfrontends/host dev

Detailed docs:

  • examples/README.md
  • examples/basic/README.md
  • examples/microfrontends/README.md

Gallery by example:

examples/basic - Base dashboard that shows enabled/disabled config features, key files, and next steps for a standard app setup.

Basic example dashboard

examples/microfrontends/host - Host runtime dashboard with remote loading states, endpoint info, and integration diagnostics.

Microfrontends host dashboard

examples/microfrontends/remote - Remote module dashboard showing exposed entry details and mount diagnostics.

Microfrontends remote dashboard

Regenerate screenshots:

pnpm capture:examples:screenshots

Setup Behavior

The postinstall setup script (bin/setup.mjs) scaffolds tsconfig.json and vite.config.ts only when:

  • INIT_CWD contains a valid package.json
  • target project is not the @atomazing-org/vite-config package itself

This prevents accidental config generation in home directories and avoids parent-level tsconfig warnings.

Validation Scripts

pnpm check:examples:build
pnpm check:examples:types
pnpm check:examples:smoke
pnpm check:examples