feature: migrate from webpack to rspack

This commit is contained in:
coderaiser 2026-07-16 12:18:43 +03:00
parent fe185cc93e
commit 0638ca32cb
6 changed files with 53 additions and 44 deletions

View file

@ -1,45 +0,0 @@
import {env} from 'node:process';
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
const isDev = env.NODE_ENV === 'development';
const clean = (a) => a.filter(Boolean);
const plugins = clean([
new MiniCssExtractPlugin({
filename: '[name].css',
}),
]);
const rules = [{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, {
loader: 'css-loader',
options: {
url: true,
},
}],
}, {
test: /\.(png|gif|svg|woff|woff2|eot|ttf)$/,
type: 'asset/inline',
}];
export default {
mode: isDev ? 'development' : 'production',
plugins,
module: {
rules,
},
optimization: {
minimize: !isDev,
minimizer: [
new CssMinimizerPlugin({
minimizerOptions: {
preset: ['default', {
svgo: false,
}],
},
}),
],
},
};