Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including requirejs-to-webpack-cli with all npm packages installed. Try it out:

var requirejsToWebpackCli = require("requirejs-to-webpack-cli")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

requirejs-to-webpack-cli v1.0.0

Translates RequireJS build configs to their webpack counterpart.


Build Status Codacy Badge Codacy Badge npm version Dependencies

CLI utility for converting RequireJS configuration JSON to a webpack configuration module.


Yarn is recommended for installation:

$ yarn global add requirejs-to-webpack-cli

But you can still use npm:

$ npm install -g requirejs-to-webpack-cli


# Default output is ./webpack.config.js
$ requirejs-to-webpack-cli <input> [output]

# Aliases
$ requirejs-to-webpack <input> [output]
$ r2w <input> [output]

# Example:
$ r2w build.config


Lots of thanks to Jamund Ferguson for his write up on how to convert to webpack from RequireJS. This tool aims to automate many of the steps outlined in that guide.


There is definitely much more that can be done to automate the configuration conversion. If you have any experience in RequireJS and webpack, please feel free to make a pull request!


Copyright (c) 2016 Alexander Martin


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free