mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 10:14:13 +00:00
feature: migrate from webpack to rspack
This commit is contained in:
parent
fe185cc93e
commit
0638ca32cb
6 changed files with 53 additions and 44 deletions
|
|
@ -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,
|
||||
}],
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue