Hiyori

raw JSON →
4.3.0 verified Sat Apr 25 auth: no javascript

A simple webpack bundler for minimal JavaScript bundling tasks. Current stable version is 4.3.0, released with support for Node 18+. Hiyori provides essential bundling features with minimal configuration, leveraging webpack under the hood but simplifying the setup. Ship TypeScript types for editor support. Suitable for small projects or quick prototyping where a full webpack configuration is overkill. Compared to tools like Parcel or esbuild, Hiyori focuses on being a straightforward wrapper around webpack, making it easy to bundle without deep webpack knowledge. Release cadence is irregular, primarily for bug fixes and updates.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/hiyori/index.js from /path/to/app.js not supported.
cause Trying to require() hiyori v4 in a CommonJS context.
fix
Switch to import statement and set 'type': 'module' in package.json, or use dynamic import: const hiyori = await import('hiyori').
error TypeError: (intermediate value).bundle is not a function
cause Incorrect default import: import hiyori from 'hiyori' where hiyori is an object with bundle property, but bundle is not exported as default.
fix
Use named import: import { bundle } from 'hiyori'.
breaking v4 drops CommonJS support; requires Node >=18 and ESM.
fix Use import syntax and ensure package.json has 'type': 'module' or use .mjs extension.
deprecated The method hiyori.watch() is deprecated in v4.3.0.
fix Use chokidar or webpack --watch directly.
gotcha Webpack devServer options passed via hiyori are ignored; use standalone webpack-dev-server.
fix Run webpack-cli serve separately or configure devServer in webpackConfig.
npm install hiyori
yarn add hiyori
pnpm add hiyori

Shows basic usage of the bundle function with entry and output options.

import { bundle } from 'hiyori';

const result = await bundle({
  entry: './src/index.js',
  output: { path: './dist', filename: 'bundle.js' },
  webpackConfig: {// optional overrides
    mode: 'production'
  }
});

console.log(result); // { stats, warnings }