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

No option to generate moduler css along with one single css which will load separately into dom #444

Open
OmKessarwani opened this issue Apr 18, 2023 · 0 comments

Comments

@OmKessarwani
Copy link

OmKessarwani commented Apr 18, 2023

I have below post css config where I'm generating css from scss file in moduler way. But I have one global scss file which I want to load direct into dom.My current code inject that gloabl scss into each module.

`postcss({
      use: [
        ['sass', { data: '@import "./src/commonStyles/_commoncss.scss";' }] // global scss injection into each `module`
      ],
      plugins: [
        autoprefixer(),
        postcssImport({
          // Resolve SCSS imports and convert to CSS
          resolve: function (filename, base) {
            return new Promise(function (resolve, reject) {
              sass.render(
                {
                  file: `${base}/${filename}`
                },
                function (err, result) {
                  if (err) {
                    reject(err)
                  } else {
                    resolve({
                      contents: result.css.toString()
                    })
                  }
                }
              )
            })
          }
        })
      ],
      modules: true, // // Include CSS in the JavaScript bundle
      extract: false // Do not extract CSS into a separate file
    })`
@OmKessarwani OmKessarwani changed the title No option generate moduler css along with one single css which will load separately into dom No option to generate moduler css along with one single css which will load separately into dom Apr 18, 2023
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

1 participant