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

Documentation updates for webpack v5 #102

Open
MikeDanilov opened this issue Oct 5, 2021 · 2 comments
Open

Documentation updates for webpack v5 #102

MikeDanilov opened this issue Oct 5, 2021 · 2 comments

Comments

@MikeDanilov
Copy link

There are only webpack v1/v2 examples in documentation. Could you please update documentation also for webpack v5?

@lucasvazq
Copy link

lucasvazq commented Jan 16, 2022

I think this probably will work for you.

module.exports = {
  module: {
    rules: [
      {
        test: /\.sass$/,
        use: [
          {
            loader: "sass-loader",
            options: {
              sassOptions: {
                importer: jsonImporter(),
              },
            },
          },
        ],
      },
    ],
  },
};

If you are using Next.js it's very simple to add this plugin.

// next.config.js
module.exports = {
  sassOptions: {
    importer: jsonImporter(),
  },
}

@MikeDanilov
Copy link
Author

MikeDanilov commented Jan 17, 2022

@lucasvazq I have shared variables in my quasar v 2.0 application. And adding just importer didn't work for me. I had to use the following code in quasar.conf.js to make it working

// we have to keep both configuration to make shared variables working
    scssLoaderOptions: {
      additionalData: '@import "src/css/global/_mixins.scss";',
      sassOptions: {
        importer: jsonImporter({
          convertCase: true,
        }),
      },
    },
    sassLoaderOptions: {
      sassOptions: {
        importer: jsonImporter({
          convertCase: true,
        }),
      },
    },

But I don't think this is correct solution.

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

2 participants