{"id":22822,"library":"vite-plugin-scorm","title":"Vite Plugin SCORM","description":"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.","status":"active","version":"0.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/humanshield-sidepack/scorm-packager","tags":["javascript"],"install":[{"cmd":"npm install vite-plugin-scorm","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-scorm","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-scorm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: requires vite >= 5.0.0 to function as a plugin.","package":"vite","optional":false}],"imports":[{"note":"Named export only. Also type imports available for ScormPackagerOptions, CourseMetadata, etc.","wrong":"import scormPackager from 'vite-plugin-scorm'; -- default export not available","symbol":"scormPackager","correct":"import { scormPackager } from 'vite-plugin-scorm'"},{"note":"Type import for TypeScript projects.","wrong":"","symbol":"ScormPackagerOptions","correct":"import type { ScormPackagerOptions } from 'vite-plugin-scorm'"},{"note":"Type import for defining custom course metadata shape.","wrong":"","symbol":"CourseMetadata","correct":"import type { CourseMetadata } from 'vite-plugin-scorm'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { scormPackager } from 'vite-plugin-scorm';\n\nexport default defineConfig({\n  plugins: [\n    scormPackager({\n      courseFile: 'src/course.ts',\n      target: 'both',\n    }),\n  ],\n});\n\n// src/course.ts\nexport const course = {\n  id: 'course-1',\n  title: 'My Course',\n  description: 'An example course',\n  masteryScore: 80,\n  minScore: 0,\n  maxScore: 100,\n};","lang":"typescript","description":"Configure vite-plugin-scorm with course metadata and build to generate SCORM 1.2 and 2004 ZIP packages."},"warnings":[{"fix":"Ensure src/course.ts exists with proper CourseMetadata export, or provide a loadCourse function.","message":"The default course file is set to 'src/course.ts'. If absent, the build may fail silently if no custom loadCourse is provided.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"All metadata must be defined at build time; no runtime modification possible.","message":"Course metadata is static at build time. Dynamic runtime updates (e.g., score changes) are not supported.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use only for production builds; ignore SCORM packaging during vite dev.","message":"The plugin runs during the closeBundle hook, meaning it cannot be used during dev server. Only works with vite build.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Remove unwanted files from build output before packaging or implement a custom solution.","message":"All build output files are included in the SCORM ZIP. There is no selective file inclusion/exclusion option.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install vite-plugin-scorm` and ensure vite >= 5.0.0 is installed.","cause":"Package not installed or version incompatible.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'vite-plugin-scorm'"},{"fix":"Use `import { scormPackager } from 'vite-plugin-scorm';`","cause":"Using wrong import (default import instead of named import).","error":"TypeError: scormPackager is not a function"},{"fix":"Ensure the exported `course` object includes all required fields. Example: { id: 'c1', title: 'Test', minScore: 0, maxScore: 100 }","cause":"Course metadata object in course file lacks required fields (id, title, minScore, maxScore).","error":"[vite-plugin-scorm] Missing required course metadata: 'id'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}