|
2 | 2 | import path from 'node:path';
|
3 | 3 | import HtmlWebpackPlugin from 'html-webpack-plugin';
|
4 | 4 | import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
|
5 |
| -import TerserPlugin from 'terser-webpack-plugin'; |
6 |
| -import CssMinimizerPlugin from 'css-minimizer-webpack-plugin'; |
7 |
| -import { target, isProd } from '../../shared.mjs'; |
| 5 | +import { target, isProd } from '../../shared/constants.mjs'; |
8 | 6 |
|
9 | 7 | export default {
|
10 |
| - target: ['web', target], |
11 |
| - devtool: isProd ? false : undefined, |
| 8 | + extends: '../../shared/webpack.config.mjs', |
12 | 9 | entry: path.join(import.meta.dirname, 'src', 'index.jsx'),
|
13 |
| - resolve: { |
14 |
| - extensions: ['...', '.tsx', '.ts', '.jsx'], |
15 |
| - }, |
16 | 10 | module: {
|
17 | 11 | rules: [
|
18 | 12 | {
|
@@ -44,20 +38,4 @@ export default {
|
44 | 38 | new HtmlWebpackPlugin({ template: 'index-rspack.html' }),
|
45 | 39 | isProd ? null : new ReactRefreshWebpackPlugin(),
|
46 | 40 | ].filter(Boolean),
|
47 |
| - optimization: { |
48 |
| - minimize: isProd, |
49 |
| - minimizer: isProd |
50 |
| - ? [ |
51 |
| - new CssMinimizerPlugin({ |
52 |
| - minify: CssMinimizerPlugin.swcMinify, |
53 |
| - }), |
54 |
| - new TerserPlugin({ |
55 |
| - minify: TerserPlugin.swcMinify, |
56 |
| - }), |
57 |
| - ] |
58 |
| - : [], |
59 |
| - }, |
60 |
| - experiments: { |
61 |
| - css: true, |
62 |
| - }, |
63 | 41 | };
|
0 commit comments