@konomi-app/k2-vite
v0.2.1
Published
Minimal kintone development environment with Vite
Readme
@konomi-app/k2-vite
🍳 Minimal kintone development environment with Vite
Features
- ⚡ Vite-powered - Fast development and build
- 🔒 SSL-ready - Automatic HTTPS for local development
- 📦 Simple output -
src/{appName}/index.ts→{appName}.js+{appName}.css - 🛠️ CLI & API - Use from command line or JavaScript
Installation
npm install @konomi-app/k2-vite vite chokidar
# or
pnpm add @konomi-app/k2-vite vite chokidarPrerequisites
For SSL certificate generation, install mkcert:
# Windows (with Chocolatey)
choco install mkcert
# macOS (with Homebrew)
brew install mkcert
# Then install the local CA
mkcert -installProject Structure
your-project/
├── src/
│ ├── app-1/
│ │ └── index.ts # Entry point for app-1
│ ├── app-2/
│ │ └── index.tsx # Entry point for app-2
│ └── shared/
│ └── utils.ts # Shared utilities
└── package.jsonOutput:
.k2/prod/
├── app-1.js
├── app-1.css
├── app-2.js
└── app-2.cssCLI Usage
Build for Production
npx k2-vite build
# With options
npx k2-vite build --input src --outdir distDevelopment Server
npx k2-vite dev
# With options
npx k2-vite dev --port 3000 --input srcOptions:
-i, --input <dir>- Input directory (default:src)-o, --outdir <dir>- Output directory (default:.k2/prodfor build,.k2/devfor dev)-c, --certdir <dir>- SSL certificate directory (default:.k2)-p, --port <number>- Dev server port (default:32767)
JavaScript API
import { build, dev, createViteConfig } from '@konomi-app/k2-vite';
// Build for production
await build({
input: 'src',
outDir: 'dist',
});
// Start development server
await dev({
input: 'src',
port: 3000,
});
// Custom Vite configuration
await build({
input: 'src',
viteConfig: {
plugins: [
/* your plugins */
],
define: {
'process.env.NODE_ENV': '"production"',
},
},
});Configuration
With vite-tsconfig-paths (Optional)
If you want to use TypeScript path aliases:
npm install vite-tsconfig-pathsThe plugin will be automatically detected and used.
Custom Vite Config
You can pass additional Vite configuration:
import { build } from '@konomi-app/k2-vite';
import react from '@vitejs/plugin-react';
await build({
viteConfig: {
plugins: [react()],
},
});License
ISC
