module-federation-examples icon indicating copy to clipboard operation
module-federation-examples copied to clipboard

css-Isolation not working in rspack example

Open varunraval9 opened this issue 1 year ago • 5 comments

I have checked css-isolation example where i run app2 (isolated app) in webpack it works as it should, but when i run it using rspack serve it does not.

i check webpack.config.js

there is css loaders are applied as below

     {
        test: /\.css$/,
        use: [
          {
            loader: 'style-loader',
            options: {
              insert: require.resolve('./styleLoader.js'),
            },
          },
          'css-loader',
        ],
      },

but there is no configuration added in rspack.config.js

i have tried same configuration in rspack , but no css applied. it seems to me that rspack does not support options.insert.

varunraval9 avatar May 09 '24 12:05 varunraval9

Consider filing an issue on rspack if you think there's a problem with css loader.

ScriptedAlchemy avatar May 09 '24 22:05 ScriptedAlchemy

Consider filing an issue on rspack if you think there's a problem with css loader.

there is no problem with rspack. this example utilizes custom css loader which is referenced only in the webpack config and not in the rspack config, which makes the example irrelevant

DanielSegal1 avatar May 25 '24 12:05 DanielSegal1

okay ill adjust

ScriptedAlchemy avatar Jun 19 '24 06:06 ScriptedAlchemy

This still needs to be fixed.

It looks like style-loader can't be used in rspack unless you set this:

experiments: {
    css: false,
},

After setting this my style loader worked as it did before in webpack.

MichaelJHaywood avatar Jul 29 '24 10:07 MichaelJHaywood

Send a pull request @MichaelJHaywood if you know what needs to change.

ScriptedAlchemy avatar Aug 09 '24 01:08 ScriptedAlchemy