dong-build
raw JSON → 0.4.5 verified Sat May 09 auth: no javascript deprecated
dong-build is a build tool for view and static file processing, part of the dong ecosystem. Current version 0.4.5, with sporadic releases. It serves as a build helper for the dong framework, focusing on compiling views and handling static assets. Compared to full-featured bundlers like webpack or Vite, dong-build is minimal and tightly coupled with dong, making it suitable only within that ecosystem. The package is deprecated in favor of more modern tooling.
Common errors
error Cannot find module 'dong-build' ↓
cause Package not installed or incorrect import path.
fix
Install with npm install dong-build@0.4.5
error ERR_REQUIRE_ESM ↓
cause Attempted to require() an ES module.
fix
Use import instead of require().
error TypeError: build is not a function ↓
cause Incorrect import: imported default instead of named export.
fix
Use import { build } from 'dong-build';
Warnings
deprecated Package is deprecated and no longer maintained. Use modern bundlers like Vite or Webpack. ↓
fix Switch to Vite or Webpack.
gotcha ESM-only; requires Node.js >=12 or bundler support for ES modules. ↓
fix Use import syntax and ensure Node version or bundler supports ESM.
breaking API changed between versions 0.3.x and 0.4.x; options object structure changed. ↓
fix Refer to documentation for 0.4.x API.
Install
npm install dong-build yarn add dong-build pnpm add dong-build Imports
- dongBuild wrong
const dongBuild = require('dong-build');correctimport dongBuild from 'dong-build'; - build wrong
const { build } = require('dong-build');correctimport { build } from 'dong-build'; - type BuildOptions wrong
import { BuildOptions } from 'dong-build';correctimport type { BuildOptions } from 'dong-build';
Quickstart
import { build } from 'dong-build';
import { resolve } from 'path';
const root = resolve(process.cwd(), 'src');
const output = resolve(process.cwd(), 'dist');
build({
root,
output,
views: 'views/**/*.html',
static: 'static/**/*'
}).then(() => {
console.log('Build complete');
}).catch(err => {
console.error('Build failed', err);
});