3

I am using nextJs and need to add support for both less and css. I want to have next-css and next-less both for a project. But It accept one at a time. Here is what I am using

const withCSS = require('@zeit/next-css')
module.exports = withCSS({
  /* config options here */
})

const withLess = require('@zeit/next-less')
module.exports = withLess({
    cssModules: false,
    lessLoaderOptions: {
        javascriptEnabled: true
    }
})

Am I including both loaders correctly? And I need javascriptEnabled: true too. How can we acchieve this configuration.

I really appreciate if you can give any hint or two.

2
  • Why do you need next-css? Commented Jan 1, 2020 at 12:08
  • 1
    Are you right. I was converting create react app to nextjs app. So for this will convert my css files to less. Thank you Commented Jan 2, 2020 at 7:23

1 Answer 1

5

This should work.

const withCSS = require('@zeit/next-css')
const withLess = require('@zeit/next-less')
module.exports = withCSS(withLess())
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.