Webpack To Rspack/Remove File Loader To Type Asset Resource

/icons/calendar.svg

Last update

Oct 17, 2024

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