rollup-loader
raw JSON → 0.3.0 verified Mon Apr 27 auth: no javascript maintenance
A webpack loader that integrates Rollup into the webpack build pipeline. Version 0.3.0 (latest) allows using Rollup to process JavaScript files before webpack finishes bundling. It accepts custom Rollup plugins and passes the processed result and sourcemaps back to webpack. Useful for leveraging Rollup's tree-shaking and ES module handling within a webpack workflow. No recent updates; appears stable but not actively developed.
Common errors
error Module not found: Error: Can't resolve 'rollup-plugin-memory' in '...' ↓
cause Missing peer dependency rollup-plugin-memory.
fix
npm install rollup-plugin-memory --save-dev
Warnings
breaking rollup-loader depends on rollup-plugin-memory which may have breaking changes. ↓
fix Pin rollup-plugin-memory version or check compatibility.
Install
npm install rollup-loader yarn add rollup-loader pnpm add rollup-loader Imports
- rollup-loader wrong
use: 'rollup-loader' without options objectcorrectmodule.exports = { module: { rules: [{ test: /\.js$/, loader: 'rollup-loader', options: { plugins: [] } }] } }
Quickstart
// webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.js$/,
loader: 'rollup-loader',
options: {
plugins: [] // Add rollup plugins here
}
}
]
}
};