Metal Tools Build Rollup

raw JSON →
2.0.6 verified Mon Apr 27 auth: no javascript deprecated

Build tool for transpiling and bundling Metal.js ES6 JavaScript files using Rollup. Version 2.0.6 is the latest stable release for the deprecated Metal.js framework. It leverages Rollup's tree-shaking and module bundling to produce optimized browser-compatible bundles. Key differentiators: designed specifically for Metal.js ecosystem, supports global variable generation for browser globals, and integrates with other Metal build tools. However, Metal.js is no longer actively maintained; users should consider migrating to modern frameworks. The package has low maintenance cadence and limited documentation.

error Error: Cannot find module 'metal-tools-build-rollup'
cause Package not installed or missing from node_modules.
fix
Run 'npm install metal-tools-build-rollup' or check your package.json.
error SyntaxError: Cannot use import statement outside a module
cause Using ESM import without 'type': 'module' in package.json.
fix
Add 'type': 'module' to your package.json, or rename file to .mjs.
error TypeError: build is not a function
cause Incorrect import: using namespace import instead of default.
fix
Use 'import build from 'metal-tools-build-rollup' instead of 'import * as build'.
deprecated Metal.js framework is deprecated; metal-tools-build-rollup is unmaintained.
fix Migrate to modern bundlers like Webpack, Rollup standalone, or Vite.
breaking Version 2.0.0 changed to ESM-only; CommonJS require() breaks.
fix Use ES import syntax (import/build from 'metal-tools-build-rollup') or use dynamic import.
gotcha Requires Node >=0.12.0; may not work with modern Node versions due to outdated dependencies.
fix Use Node 10 or earlier, or upgrade to a maintained alternative.
npm install metal-tools-build-rollup
yarn add metal-tools-build-rollup
pnpm add metal-tools-build-rollup

Build a Metal.js ES6 file into an IIFE bundle with Rollup.

import build from 'metal-tools-build-rollup';
import path from 'path';

const config = {
  entry: path.resolve('src/index.js'),
  dest: path.resolve('build/bundle.js'),
  format: 'iife',
  moduleName: 'MyApp',
  globalName: 'myApp',
  sourceMap: true
};

build(config).then(() => {
  console.log('Build complete');
}).catch(err => {
  console.error('Build failed:', err);
});