broccoli-webpack
raw JSON → 1.0.0 verified Sat Apr 25 auth: no javascript abandoned
Broccoli plugin for webpack v1 (now legacy). Version 1.0.0 is the latest stable release, last updated in 2015 and effectively abandoned. It wraps webpack as a Broccoli plugin, allowing Broccoli builds to bundle with webpack. Automatically sets context and output.path. No longer maintained; alternatives include broccoli-webpack2 or ember-cli for modern projects.
Common errors
error Error: Cannot find module 'broccoli-webpack' ↓
cause Package not installed or not in node_modules.
fix
Run 'npm install --save-dev broccoli-webpack'
error TypeError: inputNodes is not iterable ↓
cause Passed a single string instead of an array.
fix
Wrap input in an array: new WebpackWriter([inputNode], config)
error Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. ↓
cause Using webpack v2+ config (e.g., 'rules' instead of 'loaders').
fix
Use webpack v1 config format (loaders, preLoaders) or upgrade to broccoli-webpack2.
Warnings
deprecated Package uses webpack v1 API (preLoaders, output.filename only). Does not support webpack v2+ configuration (rules, plugins). ↓
fix Use broccoli-webpack2 for webpack 2+ or switch to ember-auto-import.
gotcha inputNodes must be an array, even if passing a single tree. ↓
fix Wrap single tree in an array: new WebpackWriter([tree], config).
gotcha Does not support webpack plugins properly; may require workarounds. ↓
fix Specify plugins in config as usual, but some may not work due to Broccoli tree isolation.
breaking The plugin stopped receiving updates in 2015. It is not compatible with modern Node versions or webpack 2+. ↓
fix Use a maintained alternative like broccoli-webpack2 or ember-cli.
Install
npm install broccoli-webpack yarn add broccoli-webpack pnpm add broccoli-webpack Imports
- WebpackWriter
const WebpackWriter = require('broccoli-webpack') - new WebpackWriter(inputNodes, config) wrong
new WebpackWriter('src', { entry: './main' })correctvar bundle = new WebpackWriter(['src'], { entry: './main' }) - WebpackWriter.prototype wrong
WebpackWriter.build()correctconst writer = new WebpackWriter(...); writer.build()
Quickstart
var WebpackWriter = require('broccoli-webpack');
var js_bundler = new WebpackWriter(['src'], {
entry: './main',
output: { filename: 'app.js' },
externals: { 'react': 'React', 'jquery': '$' },
devtool: 'source-map',
module: {
preLoaders: [
{ test: /\.js$/, loader: 'source-map-loader' }
]
}
});
module.exports = js_bundler;