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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@atomazing-org/vite-config

v0.2.7

Published

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

Downloads

546

Readme

Описание

  1. Introduction
  2. Installation
  3. Usage

Описание

Набор конфигов и плагинов для Vite под React-приложения c готовой интеграцией:

  • PWA (автообнаружение manifest.ts, поддержка workbox и QR в dev)
  • Module Federation для микрофронтендов
  • HTTPS (самоподписанный SSL в dev)
  • i18n через @lingui/vite-plugin
  • Проверка TypeScript через vite-plugin-checker
  • React (@vitejs/plugin-react) с Emotion и поддержкой

Установка

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

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

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

Пакет подключает плагины автоматически, однако их peer-зависимости должны быть установлены в вашем проекте (React, Lingui при использовании i18n и т.д.).

Конфигурация

Создайте или отредактируйте vite.config.ts:

Пример: базовая конфигурация

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

Пример: Module Federation (host)

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)

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

PWA: manifest и Workbox

Создать manifest.ts можно командой:

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

Можно также создать свой workbox.config.ts. Если файл не найден, используется дефолтная конфигурация из пакета.

Конфигурация TypeScript

Подключите общий tsconfig:

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

Экспорты из пакета

Помимо createViteConfig, повторно экспортируются:

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

Это позволяет использовать их типы и утилиты напрямую из пакета.

Примечания

  • QR-код для PWA dev генерируется только при enableDevPwa: true и доступен для локальных IP 192.168.0.*.
  • HTTPS активируется плагином @vitejs/plugin-basic-ssl при enableHttps: true.
  • Логирование инициализации конфигурации структурировано по блокам для удобства диагностики.