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

buildmind

v3.0.5

Published

Shared Vite build scripts for frontend projects

Readme

buildmind

Configurable Vite development and build commands, supporting Vue, React, and multi sub-app builds.

Requirements

  • Node.js 20 or higher
  • pnpm 9

Installation

pnpm add -D buildmind vite

The application's package.json can use the buildmind command directly:

{
    "scripts": {
        "dev": "buildmind dev --mode dev",
        "build": "buildmind build --mode prod"
    }
}

buildmind.config.ts

The configuration file goes in the project root. Minimum configuration example:

import { defineConfig } from 'buildmind'

export default defineConfig({
    framework: 'vue',
})

Multi sub-app example:

import { defineConfig } from 'buildmind'

export default defineConfig({
    framework: 'vue',
    main: false,
    apps: ['admin', 'portal'],
    options: {
        admin: {
            viteBase: '/admin/',
            routes: ['*'],
        },
        portal: {
            viteBase: '/portal/',
            routes: ['Home'],
        },
    },
})

Route Generation Plugins

The buildmind core does not assume a project's router directory or manifest format. When routes need to be trimmed per sub-app, enable the corresponding plugin explicitly.

The Vue module routes plugin scans src/router/modules by default and generates src/router/router.modules.generated.js:

import { defineConfig, vueRouterModules } from 'buildmind'

export default defineConfig({
    framework: 'vue',
    apps: ['portal'],
    options: {
        portal: { routes: ['Home'] },
    },
    buildmindPlugins: [vueRouterModules()],
})

The React registry plugin reads src/config/route-registry.manifest.json by default and generates src/config/route-registry.generated.[subapp].ts:

import { defineConfig, reactRouteRegistry } from 'buildmind'

export default defineConfig({
    framework: 'react',
    apps: ['portal'],
    options: {
        portal: { routes: ['Home'] },
    },
    buildmindPlugins: [reactRouteRegistry()],
})

The manifest can use the generic only, exclude, and subapps overrides:

{
    "Home": {
        "defaultPath": "/",
        "importPath": "@/views/home",
        "subapps": {
            "portal": {
                "importPath": "@/views/portal/home"
            }
        }
    },
    "PortalSettings": {
        "defaultPath": "/settings",
        "importPath": "@/views/portal/settings",
        "only": ["portal"]
    }
}

Both plugins' input and output paths can be overridden via plugin parameters. buildmindPlugins is for buildmind lifecycle plugins; plugins is still used for regular Vite plugins.

Alias

Relative paths in alias are resolved from the project root. Apart from @ pointing to src, no project-specific aliases are included:

import { defineConfig } from 'buildmind'

export default defineConfig({
    framework: 'vue',
    alias: {
        '@shared': '../../packages/shared/src',
    },
})

When an application needs to read apps and options in browser code, use virtual:buildmind/config. This virtual module only exposes serializable runtime configuration and will not bundle aliases, plugins, or Node code into the browser:

import config from 'virtual:buildmind/config'

TypeScript projects can add /// <reference types="buildmind/client" /> to their environment declarations.

Custom CLI options

Projects can declare custom command-line options without adding project-specific behavior to buildmind. Consumed options are available in the buildmind context, and can optionally be injected as Vite defines:

import { defineConfig } from 'buildmind'

export default defineConfig({
    cli: {
        options: {
            login: {
                type: 'string',
                define: '__APP_LOGIN_WAY__',
            },
        },
    },
    define: {
        __APP_LOGIN_WAY__: null,
    },
})
buildmind dev --mode dev --login jg --base jg

Here --login is consumed by buildmind and overrides the project define default, while the undeclared Vite option --base is preserved. The same custom options are supported by both dev and build.

Commands

buildmind dev [Vite args]
buildmind build [Vite args]
buildmind --help

Build all sub-apps:

buildmind build --mode prod -- --subapps all

Publishing

pnpm build obfuscates all JavaScript files in dist after TypeScript compilation; type declaration files are left untouched.

pnpm install
pnpm run pack:check
npm publish --access public