question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't set less variable from webpack

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

// webpack.config.js
module.exports = {
  rules: [{
    test: /\.less$/,
    use: [{
      loader: 'style-loader',
    }, {
      loader: 'css-loader', // translates CSS into CommonJS
    }, {
      loader: 'less-loader', // compiles Less to CSS
     options: {
       lessOptions: { // If you are using less-loader@5 please spread the lessOptions to options directly
         modifyVars: {
           'grid-gutter-width':'12px'
         },
         javascriptEnabled: true,
       },
     },
    }],
    // ...other rules
  }],
  // ...other config
}

What is expected?

Grid column padding will be 6px

What is actually happening?

Nothing

Environment Info
antd 4.2.4
React 16.13.1
System Mac OS Latest
Browser 81.0.4044.138

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yoyo837commented, May 20, 2020

Yes, it works in v3. It was removed in 4.0. There seems to be no way to set it to global.

@afc163 @zombieJ Need to implement it again?

0reactions
ovidius72commented, Jan 11, 2021

I need to set custom breakpoints. Is there any update on this. ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing less variables from webpack - Stack Overflow
Save this question. Show activity on this post. I'm trying to pass less variables within a webpack configuration to the less loader, naturally....
Read more >
less-loader | webpack - JS.ORG
Allows setting the options passed through to Less based off of the loader ... This is especially useful when some of your Less...
Read more >
Environment Variables - webpack
The webpack command line environment option --env allows you to pass in as many environment variables as you like. Environment variables will be...
Read more >
Module Variables - webpack
This section covers all variables available in code compiled with webpack. Modules will have access to certain data from the compilation process through ......
Read more >
Entry Points - webpack
js', }, };. Single Entry Syntax is a great choice when you are looking to quickly set up a webpack configuration for an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found