Registry / devops / vite-plugin-scorm

vite-plugin-scorm

JSON →
library0.0.2jsnpmunverified

A Vite plugin (v0.0.2, early release) that packages build output into SCORM-compliant ZIP files for SCORM 1.2 and SCORM 2004 4th Edition. It runs during the closeBundle hook, validates course metadata, and generates imsmanifest.xml with ZIPs. Key differentiator: integrates SCORM packaging into Vite builds with TypeScript support, offering a custom loader for non-Svelte projects. Currently limited to single SCO packages with no sequencing or navigation rules.

npm install vite-plugin-scorm
INSTALL
IMPORT
SIG · VITE-PLUGIN-SCORM
V
vite-plugin-scorm
devopsjavascriptv0.0.2
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.

scormPackager
import { scormPackager } from 'vite-plugin-scorm'
import scormPackager from 'vite-plugin-scorm'; -- default export not available
Named export only. Also type imports available for ScormPackagerOptions, CourseMetadata, etc.
ScormPackagerOptions
import type { ScormPackagerOptions } from 'vite-plugin-scorm'
Type import for TypeScript projects.
CourseMetadata
import type { CourseMetadata } from 'vite-plugin-scorm'
Type import for defining custom course metadata shape.

Configure vite-plugin-scorm with course metadata and build to generate SCORM 1.2 and 2004 ZIP packages.

// vite.config.ts import { defineConfig } from 'vite'; import { scormPackager } from 'vite-plugin-scorm'; export default defineConfig({ plugins: [ scormPackager({ courseFile: 'src/course.ts', target: 'both', }), ], }); // src/course.ts export const course = { id: 'course-1', title: 'My Course', description: 'An example course', masteryScore: 80, minScore: 0, maxScore: 100, };
Debug
Known issues
gotchaThe default course file is set to 'src/course.ts'. If absent, the build may fail silently if no custom loadCourse is provided.
fix
Ensure src/course.ts exists with proper CourseMetadata export, or provide a loadCourse function.
affects: >=0.0.0
gotchaCourse metadata is static at build time. Dynamic runtime updates (e.g., score changes) are not supported.
fix
All metadata must be defined at build time; no runtime modification possible.
affects: >=0.0.0
gotchaThe plugin runs during the closeBundle hook, meaning it cannot be used during dev server. Only works with vite build.
fix
Use only for production builds; ignore SCORM packaging during vite dev.
affects: >=0.0.0
gotchaAll build output files are included in the SCORM ZIP. There is no selective file inclusion/exclusion option.
fix
Remove unwanted files from build output before packaging or implement a custom solution.
affects: >=0.0.0
Errors
Common errors & fixes
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'vite-plugin-scorm'
Package not installed or version incompatible.
fix
Run `npm install vite-plugin-scorm` and ensure vite >= 5.0.0 is installed.
TypeError: scormPackager is not a function
Using wrong import (default import instead of named import).
fix
Use `import { scormPackager } from 'vite-plugin-scorm';`
[vite-plugin-scorm] Missing required course metadata: 'id'
Course metadata object in course file lacks required fields (id, title, minScore, maxScore).
fix
Ensure the exported `course` object includes all required fields. Example: { id: 'c1', title: 'Test', minScore: 0, maxScore: 100 }
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
viterequiredPeer dependency: requires vite >= 5.0.0 to function as a plugin.
Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
vite-plugin-scorm — npm install vite-plugin-scorm · libregistry