Webpack To Rspack/Replace Webpack Virtual Modules To Rspack Plugin Virtual Module

1.0.0Last update Oct 17, 2024
by@dfordp

Change import from webpack-virtual-modules to rspack-plugin-virtual-module.

Before

// change import module from webpack-virtual-modules to rspack-plugin-virtual-module
//track the variable which is being assigning to the modules
var VirtualModulesPlugin = require('webpack-virtual-modules');
module.exports = {
// ...
plugins: [
//change to respective assigned variable
new VirtualModulesPlugin({
// ...
}),
],
};

After

var RspackVirtualModulePlugin = require('rspack-plugin-virtual-module');
module.exports = {
// ...
plugins: [
new RspackVirtualModulePlugin({
// ...
}),
],
};

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now