Packly
raw JSON → 0.0.4 verified Sat Apr 25 auth: no javascript
Packly is an HTML bundler for JavaScript applications. The current stable version is v0.0.4, released on an unscheduled cadence. It bundles HTML files and their dependencies into a single output. Key differentiators: lightweight, no heavy configuration, and TypeScript support. As an early-stage project, it may have limited features compared to mature bundlers like webpack or Parcel. Suitable for simple projects needing quick bundling without complex setups.
Common errors
error Cannot find module 'packly' ↓
cause Package not installed or module resolution misconfigured.
fix
Run 'npm install packly' and ensure import path is correct.
error TypeError: packly is not a function ↓
cause Using default import incorrectly or wrong import statement.
fix
Use 'import { bundle } from 'packly' for named function.
error SyntaxError: Cannot use import statement outside a module ↓
cause Running ESM code in a CommonJS context.
fix
Add 'type': 'module' to package.json or rename file to .mjs.
Warnings
gotcha API may change in future releases without major version bump. ↓
fix Pin dependency to exact version.
gotcha Only ESM imports are supported; CommonJS require throws error. ↓
fix Use ES module syntax or set type: 'module' in package.json.
gotcha TypeScript types are included but may be incomplete. ↓
fix Check .d.ts files for missing exports.
Install
npm install packly yarn add packly pnpm add packly Imports
- bundle wrong
const bundle = require('packly')correctimport { bundle } from 'packly' - PacklyOptions wrong
import { PacklyOptions } from 'packly'correctimport type { PacklyOptions } from 'packly' - default wrong
import { default as packly } from 'packly'correctimport packly from 'packly'
Quickstart
import { bundle } from 'packly';
async function build() {
const result = await bundle('src/index.html', {
outdir: 'dist',
minify: true,
});
console.log('Bundled files:', result.files);
}
build();