Skip to content

Commit 645c27f

Browse files
committed
fix: remove experiments.css
1 parent e7cc19b commit 645c27f

File tree

30 files changed

+96
-94
lines changed

30 files changed

+96
-94
lines changed

rspack/builtin-swc-loader/rspack.config.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ export default defineConfig({
1414
entry: {
1515
main: './src/index.jsx',
1616
},
17-
experiments: {
18-
css: true,
19-
},
2017
resolve: {
2118
extensions: ['...', '.jsx'],
2219
alias: {
@@ -25,6 +22,10 @@ export default defineConfig({
2522
},
2623
module: {
2724
rules: [
25+
{
26+
test: /\.css$/,
27+
type: 'css',
28+
},
2829
{
2930
test: /\.(jsx|js)$/,
3031
use: {

rspack/cra-ts/rspack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ const config = {
55
entry: {
66
main: './src/index.tsx',
77
},
8-
experiments: {
9-
css: true,
10-
},
118
resolve: {
129
extensions: ['...', '.ts', '.tsx', '.jsx'],
1310
},
1411
module: {
1512
rules: [
13+
{
14+
test: /\.css$/,
15+
type: 'css',
16+
},
1617
{
1718
test: /\.tsx$/,
1819
use: {

rspack/cra/rspack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ const config = {
55
entry: {
66
main: './src/index.jsx',
77
},
8-
experiments: {
9-
css: true,
10-
},
118
resolve: {
129
extensions: ['...', '.ts', '.tsx', '.jsx'],
1310
},
1411
module: {
1512
rules: [
13+
{
14+
test: /\.css$/,
15+
type: 'css',
16+
},
1617
{
1718
test: /\.jsx$/,
1819
use: {

rspack/css-chunking-plugin/rspack.config.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,30 @@ const { rspack } = require('@rspack/core');
33
/** @type {import('@rspack/cli').Configuration} */
44
const config = {
55
entry: './src/index.js',
6+
module: {
7+
rules: [
8+
{
9+
test: /\.css$/,
10+
type: 'css',
11+
},
12+
],
13+
},
614
plugins: [
715
new rspack.HtmlRspackPlugin({
816
template: './index.html',
917
}),
1018
// Without using CssChunkingPlugin, the current splitChunks configuration will split CSS modules into multiple chunks, causing CSS style errors
1119
new rspack.experiments.CssChunkingPlugin({
12-
// options
20+
// options
1321
}),
1422
],
15-
experiments: {
16-
css: true,
17-
},
1823
optimization: {
1924
minimize: false,
2025
splitChunks: {
21-
maxSize: 100,
22-
minSize: 0,
23-
}
24-
}
26+
maxSize: 100,
27+
minSize: 0,
28+
},
29+
},
2530
};
2631

2732
module.exports = config;

rspack/css-parser-generator-options/rspack.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ const config = {
1717
},
1818
},
1919
rules: [
20+
{
21+
test: /\.css$/,
22+
exclude: path.resolve(__dirname, 'src/legacy'),
23+
type: 'css/auto',
24+
},
2025
{
2126
// files in src/legacy and ends with .css will be CSS Modules
2227
include: path.resolve(__dirname, 'src/legacy'),
@@ -42,9 +47,6 @@ const config = {
4247
template: './index.html',
4348
}),
4449
],
45-
experiments: {
46-
css: true,
47-
},
4850
};
4951

5052
module.exports = config;

rspack/lightingcss-loader/rspack.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,5 @@ const config = {
2424
template: './index.html',
2525
}),
2626
],
27-
experiments: {
28-
css: true,
29-
},
3027
};
3128
module.exports = config;

rspack/loader-compat/rspack.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ const config = {
99
resolve: {
1010
extensions: ['...', '.ts', '.tsx', '.jsx'],
1111
},
12-
experiments: {
13-
css: true,
14-
},
1512
module: {
1613
rules: [
1714
{

rspack/monaco-editor-js/rspack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ module.exports = {
1010
filename: '[name].bundle.js',
1111
path: path.resolve(__dirname, 'dist'),
1212
},
13-
experiments: {
14-
css: true,
15-
},
1613
module: {
1714
rules: [
15+
{
16+
test: /\.css$/,
17+
type: 'css',
18+
},
1819
{
1920
test: /\.ttf$/,
2021
type: 'asset/resource',

rspack/monaco-editor-ts-react/rspack.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ module.exports = {
1717
filename: '[name].bundle.js',
1818
path: path.resolve(__dirname, 'dist'),
1919
},
20-
experiments: {
21-
css: true,
22-
},
2320
module: {
2421
rules: [
22+
{
23+
test: /\.css$/,
24+
type: 'css',
25+
},
2526
{
2627
test: /\.ttf$/,
2728
type: 'asset/resource',
@@ -72,5 +73,5 @@ module.exports = {
7273
new rspack.HtmlRspackPlugin({
7374
template: './src/index.html',
7475
}),
75-
]
76+
],
7677
};

rspack/monaco-editor-webpack-plugin/rspack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ module.exports = {
1111
filename: '[name].bundle.js',
1212
path: path.resolve(__dirname, 'dist'),
1313
},
14-
experiments: {
15-
css: true,
16-
},
1714
module: {
1815
rules: [
16+
{
17+
test: /\.css$/,
18+
type: 'css',
19+
},
1920
{
2021
test: /\.ttf$/,
2122
type: 'asset/resource',

0 commit comments

Comments
 (0)