taskr-rollup
raw JSON → 1.0.0 verified Mon Apr 27 auth: no javascript maintenance
Rollup plugin for Taskr (v1.0.0, last released in 2019). Enables Rollup bundling inside Taskr task pipelines. Requires Taskr ^1.1.0 and Rollup 1.x. Aims to provide a simple API for Rollup integration within Taskr's generator-based flow. No active development; last commit years ago. Alternatives include using Rollup standalone or with other build tools.
Common errors
error Error: Cannot find module 'rollup' ↓
cause Rollup peer dependency not installed or incorrect version
fix
Install rollup@1.x as a dev dependency: npm install rollup@1.0.0
error TypeError: task.source(...).rollup is not a function ↓
cause Taskr version <1.1.0 or plugin not loaded correctly
fix
Ensure taskr >=1.1.0 and require('taskr-rollup') is called as a function in the plugins list.
error RollupError: You must specify an 'output' option ↓
cause Missing 'output' in .rollup() options
fix
Add output object: .rollup({ output: { file: 'bundle.js', format: 'cjs' } })
Warnings
deprecated Rollup 1.x only; incompatible with Rollup >=2.x ↓
fix Use Rollup 1.x or migrate to another Rollup integration (e.g., directly use rollup or gulp-rollup).
gotcha Generator function required; task must be a generator ↓
fix Use function* (yield) instead of async/await.
gotcha Options 'input' is not supported; use .source() instead ↓
fix Do not pass 'input' in .rollup() options; use .source() to set entry.
breaking Peer dependency taskr must be ^1.1.0; older versions incompatible ↓
fix Upgrade taskr to >=1.1.0 and <2.0.0.
breaking Peer dependency rollup must be 1.x; version 0.x incompatible ↓
fix Use Rollup 1.x (e.g., `npm install rollup@1.0.0`).
Install
npm install taskr-rollup yarn add taskr-rollup pnpm add taskr-rollup Imports
- taskr-rollup wrong
const rollup = require('taskr-rollup')correctplugins: [require('taskr-rollup')()] - rollup wrong
import rollup from 'rollup'; // ESM not supported in taskr-rollup contextcorrectconst rollup = require('rollup'); - taskr wrong
import taskr from 'taskr'; // CJS onlycorrectconst taskr = require('taskr');
Quickstart
// Taskfile.js
exports.default = function* (task) {
yield task
.source('src/main.js')
.rollup({
output: { file: 'dist/bundle.js', format: 'cjs' },
plugins: []
})
.target('dist');
};