Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css-Isolation not working in rspack example #3861

Open
varunraval9 opened this issue May 9, 2024 · 5 comments
Open

css-Isolation not working in rspack example #3861

varunraval9 opened this issue May 9, 2024 · 5 comments

Comments

@varunraval9
Copy link

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.

@ScriptedAlchemy
Copy link
Member

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

@DanielSegal1
Copy link

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

@ScriptedAlchemy
Copy link
Member

okay ill adjust

@MichaelJHaywood
Copy link

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.

@ScriptedAlchemy
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants