Skulk
raw JSON → 0.1.1 verified Sat Apr 25 auth: no javascript
Skulk (v0.1.1) is a configurable Browserify bundler and livereloading server for building client and/or client+server apps. It supports multiple bundles, factor-bundle, and CSS splitting. It aims to reduce boilerplate by providing presets and a unified config. Dev mode uses Browserify + watchify, an Express server for serving bundles from memory, and tiny-lr for livereload. Prod mode writes bundles to disk. This is an early release with incomplete API (many TODO items).
Common errors
error TypeError: Path must be a string. Received undefined ↓
cause Missing or invalid `entry` or `output` in bundle config.
fix
Ensure each bundle has a valid
entry (string) and output (string). error Error: Cannot find module 'watchify' ↓
cause watchify is an optional peer dependency not installed.
fix
Install watchify:
npm install --save-dev watchify error Error: Cannot find module 'browserify' ↓
cause browserify is a required dependency not installed.
fix
Install browserify:
npm install browserify Warnings
breaking Skulk is in early development (v0.1.1) and the API is unstable. Many features are not yet implemented (e.g., CSS splitting, multiple bundles, factor-bundle). Expect breaking changes. ↓
fix Pin to a specific version and test updates thoroughly.
deprecated The `insert-css` dependency is intentionally omitted; CSS handling is planned for future releases. ↓
fix Use a separate CSS bundler (e.g., split-css) or wait for built-in support.
gotcha Running `skulk.build` without providing required config will throw a TypeError. ↓
fix Always pass a valid config object with at least `bundles` array and `outputDir`.
gotcha Watch mode requires `watchify` to be installed separately. missing peer dep may cause silent failures. ↓
fix Install `watchify` as a dependency.
gotcha The `startDevServer` function is not yet exported; the API is incomplete. Use `skulk.watch` instead. ↓
fix Use `watch` method for dev server until `startDevServer` is available.
Install
npm install skulk yarn add skulk pnpm add skulk Imports
- default wrong
const skulk = require('skulk')correctimport skulk from 'skulk' - createBundler wrong
const createBundler = require('skulk').createBundlercorrectimport { createBundler } from 'skulk' - startDevServer
import { startDevServer } from 'skulk' - SkulkConfig
import type { SkulkConfig } from 'skulk'
Quickstart
import skulk from 'skulk';
const config = {
outputDir: './dist',
presets: [],
bundles: [
{
name: 'app',
entry: './src/index.js',
output: 'bundle.js'
}
]
};
// Prod mode
skulk.build(config).then(() => console.log('done'));
// Dev mode with livereload
skulk.watch(config).then(server => {
console.log('Dev server running on port 3000');
});