elchininet / postcss-rtlcss

PostCSS plugin to automatically build Cascading Style Sheets (CSS) with Left-To-Right (LTR) and Right-To-Left (RTL) rules using RTLCSS
https://elchininet.github.io/postcss-rtlcss/
Apache License 2.0
97 stars 14 forks source link

Including postcss-rtlcss with Angular12 with SCSS base styles later compiled to CSS #167

Closed Kavshree closed 1 year ago

Kavshree commented 1 year ago

I am trying to use this library in my Angular 12 project with a custom webpack. I am getting this error: "_Module build failed (from ./nodemodules/sass-loader/dist/cjs.js): SassError: Invalid CSS after "i": expected 1 selector or at-rule, was 'import api from "!.' on line 1 of src/app/... from sass-loader/dist/cjs.js file"

module.exports = (config, options) => {
    addRtlConfig = (config) => {
        return {
            ...config, *//has all the existing default configs*
            module: {
                ...config.module,
                rules: [
                    ...config.module.rules,
                    {
                    test: /\.scss$|\.sass$/,
                      use: [
                        'style-loader',
                        'css-loader',
                        {
                          'loader': 'postcss-loader',
                          'options': {
                            postcssOptions: {
                                plugins: () => [require('postcss-rtlcss')({})],
                            }
                          }
                        },
                        'sass-loader'
                      ]
                    },
                  ]
                }
            }
        }
    return addRtlConfig(config);
}

Please guide if I am using this incorrectly!

elchininet commented 1 year ago

Hi @Kavshree, It is hard to support you without having your complete set up. Please, provide me with the link of the repo in which you are having your issue or create a minimum reproducible git repo in which the issue can be reproduced. But before that, consult this this issue. There, @MatasRut posted a git repo of an angular project using SASS and postcss-rtlcss, maybe it can help you. Regards

elchininet commented 1 year ago

Hi @Kavshree, did you resolve your issue? If the issue is not resolved, please, provide me with a repo in which the issue can be reproduced. Regards

elchininet commented 1 year ago

Hi @Kavshree, It seems that your issue is solved or you are not interested on it anymore. If you have another issue, please open a new one. Regards