Files
Iceberg/README.md
T

2.4 KiB

Iceberg

Iceberg is an early-stage, framework-independent JavaScript build tool for production frontend builds. It uses Rolldown for JavaScript and TypeScript bundling and Lightning CSS for CSS processing.

Current support

  • iceberg build, --help, and --version
  • index.html with one local module script entry
  • JavaScript, TypeScript, JSX/TSX syntax supported by Rolldown
  • npm and relative ESM imports
  • CSS imported from JavaScript and linked from HTML, including CSS @import
  • common image and font asset imports
  • hashed JavaScript, CSS, and emitted asset filenames
  • minification, tree shaking, optional source maps, base paths, and a small iceberg.config.js
  • programmatic build() and defineConfig() APIs

Installation and quick start

npm install -D @fretuks/iceberg
{ "scripts": { "build": "iceberg build" } }

Run npm run build from a project containing index.html and a module script such as /src/main.js. Iceberg writes production files to dist/.

Configuration

Iceberg works without configuration. The optional iceberg.config.js file supports:

import { defineConfig } from '@fretuks/iceberg';

export default defineConfig({
  root: process.cwd(),
  base: '/site/',
  build: { outDir: 'build', minify: true, sourcemap: false, emptyOutDir: true }
});

Frost CSS

Frost is supported through its normal npm export; Iceberg contains no Frost-specific logic:

npm install @fretuks/frost
import '@fretuks/frost';

The inspected Frost package is @fretuks/frost@0.3.0. Its . and ./frost.css exports point to precompiled frost.css, which imports the other CSS modules through ordinary CSS imports. The working example is in examples/frost.

Programmatic API

import { build, defineConfig } from '@fretuks/iceberg';

await build(defineConfig({ build: { outDir: 'dist', minify: true } }));

Known limitations

Phase 1 intentionally has no development server, HMR, preview command, framework adapters, SSR, plugin API, or scaffolding. HTML currently supports one local module script entry. CSS asset URL rewriting beyond the standard relative output layout is still conservative; projects should keep CSS assets next to the stylesheet or use imported assets where possible.

License

MIT. Iceberg is in early development; APIs may evolve before the 1.0 release.