module-federation / module-federation-examples

Implementation examples of module federation , by the creators of module federation
https://module-federation.io/
MIT License
5.66k stars 1.75k forks source link

css-isolation example with rspack doesn't isolate css #4248

Closed MichaelJHaywood closed 3 months ago

MichaelJHaywood commented 3 months ago

When running the legacy:start script and clicking the button to change everything to yellow, it only changes the app2 background to yellow. When using start it changes the whole background to yellow.

I found this as I was looking for an example for how to use rspack with a custom style loader as I can't get it to work after changing from webpack. It looks like your example doesn't have a section in the rspack file similar to this:

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

I'm unable to get this working with rspack currently.

MichaelJHaywood commented 3 months ago

Duplicate of #3861