Webpack To Rspack/Remove File Loader To Type Asset Resource

1.0.2Last update Oct 17, 2024
by@dfordp

Rspack implements Webpack 5's Asset Modules, using asset modules to replace file-loader to 'asset/resource' for better performance.

Before

module.exports = {
module: {
rules: [{
use: ['file-loader'],
}, ],
},
};

After

module.exports = {
module: {
rules: [{
type: 'asset/resource',
}, ],
},
};

Build custom codemods

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

background illustrationGet Started Now