Registry / devops / vite-gleam

vite-gleam

JSON →
library1.7.1jsnpmunverified

Vite plugin to import Gleam (*.gleam) files directly in JavaScript/TypeScript projects. Current version 1.7.1 targets Vite 5 (Y digit reflects Vite major version, e.g., 1.x.y for Vite 4, 1.7.x for Vite 5). Released actively alongside Gleam ecosystem. Key differentiator: enables seamless integration of Gleam code into Vite builds without separate compilation step.

npm install vite-gleam
INSTALL
IMPORT
SIG · VITE-GLEAM
V
vite-gleam
devopsjavascriptv1.7.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gleam
import gleam from 'vite-gleam'
const gleam = require('vite-gleam')
ESM-only; not compatible with CommonJS require()
gleam
import gleam from 'vite-gleam'
import { gleam } from 'vite-gleam'
Default export, not named
ViteGleamOptions
import type { ViteGleamOptions } from 'vite-gleam'
import { ViteGleamOptions } from 'vite-gleam'
TypeScript type, not a runtime value; use 'import type'

Install vite-gleam, add plugin to Vite config, then import .gleam files directly.

// vite.config.ts import { defineConfig } from 'vite'; import gleam from 'vite-gleam'; export default defineConfig({ plugins: [gleam()], });
Debug
Known issues
breakingBreaking change: Vite major version update requires matching vite-gleam major version. Version format X.Y.Z where X is breaking, Y is Vite version, Z is minor.
fix
Ensure vite-gleam version's Y digit matches Vite major version (e.g., 1.7.x for Vite 5). Check release notes for breaking changes between X increments.
affects: >=1.0.0
gotchaTypeScript LSP reports error when importing .gleam files without type declarations.
fix
Add `declare module "*.gleam";` in a .d.ts file or use ts-gleam for full type support.
affects: >=0.0.0
gotchaPlugin must be placed before other plugins that transform imports (like @vitejs/plugin-react).
fix
Ensure gleam() is first in the plugins array.
affects: >=1.0.0
gotchaGleam compiler must be installed separately; vite-gleam does not include it.
fix
Install Gleam (https://gleam.run) and have a gleam.toml in project root.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'vite-gleam'
Missing installation or wrong import path.
fix
Run `npm install vite-gleam` (dev dependency) and import using `import gleam from 'vite-gleam'`.
Cannot use import statement outside a module
Using ESM syntax in a CommonJS context.
fix
Set `"type": "module"` in package.json or rename file to .mjs.
Upgrade
Version history
1.7.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
vite-gleam — npm install vite-gleam · libregistry