Registry / web-framework / compack

compack

JSON →
library0.1.10jsnpmunverified

Compack is a command-line interface (CLI) tool designed to bundle Web Components by consolidating their individual HTML, CSS, and JavaScript files into a single distributable HTML file. This approach aimed to facilitate the packaging and distribution of components that could then be imported into web applications using HTML Imports. The package is currently at version 0.1.10. Given its last commit was approximately eight years ago and its core reliance on HTML Imports (which have been deprecated and removed from modern browsers), the project is no longer actively maintained and its output is not directly usable in contemporary web development without significant polyfilling or refactoring. Its key differentiator, the use of HTML Imports for component integration, is now a critical limitation.

npm install compack
INSTALL
IMPORT
SIG · COMPACK
C
compack
web-frameworkjavascriptv0.1.10
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

Compack CLI
npm install -g compack compack --help
Compack is a global command-line tool, not a library intended for programmatic import into JavaScript or TypeScript files. Its functionality is accessed via shell commands.

Demonstrates global installation, component boilerplate generation, building a component, and starting a development server, highlighting its use of deprecated HTML Imports.

npm install -g compack # Create boilerplate for a new component compack --create my-first-component # Navigate into the component directory cd my-first-component # Install any component-specific dependencies (if package.json exists) npm install # Build and bundle the component into a single HTML file compack # Start a development server with live reload compack --server # To use the component in an HTML file (note: relies on deprecated HTML Imports) // Add a test.html file in the parent directory of 'my-first-component.html' // and ensure webcomponents.min.js polyfill is accessible. /* <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Testing My Component</title> <script src="webcomponents.min.js"></script> <link rel="import" href="./my-first-component/my-first-component.html"> </head> <body> <my-first-component></my-first-component> </body> </html> */
compack --version
Debug
Known issues
breakingThe primary output of Compack relies on HTML Imports (<link rel="import">), which have been deprecated and removed from all major modern browsers (e.g., Chrome 73+). This makes components bundled by Compack largely unusable in current web environments without substantial polyfilling or refactoring to use ES Modules.
fix
Modern Web Component development primarily uses ES Modules for component loading and dependency management. Developers should consider modern bundlers (e.g., Rollup, Webpack, Vite) and frameworks (e.g., Lit, Stencil) that natively support ES Modules for building and distributing Web Components. The `@webcomponents/html-imports` polyfill can be used for limited legacy support, but full browser support is not guaranteed.
affects: >=0.1.0
deprecatedThe project appears to be abandoned, with no active development or updates since 2018. The last published version is 0.1.10. This implies no support for newer Web Component specifications or modern JavaScript features.
fix
Migrate to actively maintained Web Component tools and libraries that embrace current web standards and best practices.
affects: <=0.1.10
gotchaThe `--server` option starts a development server on `http://localhost:8181`. This port might conflict with other local services or development servers.
fix
Check for port conflicts before running the server. The documentation does not provide an option to configure a different port, so manual intervention or proxy setup might be required if conflicts occur.
affects: >=0.1.0
Errors
Common errors & fixes
command not found: compack
The `compack` package was not installed globally or is not in the system's PATH.
fix
Install `compack` globally using `npm install -g compack`.
Error: Cannot find module 'component.json' or 'components.json'
The `compack` command was run in a directory that does not contain a `component.json` configuration file, or the file is misspelled/missing.
fix
Ensure you are in the root directory of a component project created with `compack --create` or that a valid `component.json` file exists in the current working directory.
Failed to load resource: net::ERR_FILE_NOT_FOUND (when loading .html or .js)
This error often occurs when the `compack` server is not running, or the HTML file attempting to import the component has an incorrect path to the bundled component or the `webcomponents.min.js` polyfill.
fix
Start the development server with `compack --server` or ensure all file paths in your test HTML are correct relative to the location of the bundled component and polyfill scripts.
Upgrade
Version history
0.1.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
8
OpenAI (training)
1
Resources
compack — npm install compack · libregistry