Ant-design-vue: document error vue.config.js less options

Created on 1 May 2020  ·  3Comments  ·  Source: vueComponent/ant-design-vue

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.5.4

Environment

mac chrome vue2.6.11 vue-cli3

Reproduction link

https://antdv.com/docs/vue/customize-theme-cn/

Steps to reproduce

from =================
// vue.config.js
module.exports = {
css: {
loaderOptions: {
less: {
modifyVars: {
'primary-color': '#1DA57A',
'link-color': '#1DA57A',
'border-radius-base': '2px',
},
javascriptEnabled: true,
},
},
},
};

to =============

module.exports = {
css: {
loaderOptions: {
less: {
lessOptions: {
modifyVars: {
'primary-color': '#1DA57A',
'link-color': '#1DA57A',
'border-radius-base': '2px',
},
javascriptEnabled: true,
}
},
},
},
};

### What is expected?
-

### What is actually happening?
-

Most helpful comment

The same vue.config.js file gave me compile errors when I updated less-loader to version 6.0.0, which had breaking changes (see 6.0.0 release note)

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      less: {
        javascriptEnabled: true
      }
    }
  }
}

You can make this work either by downgrading less-loader back to 5.0.0:

npm install --save-dev [email protected]

or by making your vue config work with the latest version of less-loader (6.0.0) by moving less-specific options (e.g. javascriptEnabled) to lessOptions

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true
        }
      }
    }
  }
}

Might be something to consider for PR https://github.com/vueComponent/ant-design-vue/pull/2150

All 3 comments

The same vue.config.js file gave me compile errors when I updated less-loader to version 6.0.0, which had breaking changes (see 6.0.0 release note)

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      less: {
        javascriptEnabled: true
      }
    }
  }
}

You can make this work either by downgrading less-loader back to 5.0.0:

npm install --save-dev [email protected]

or by making your vue config work with the latest version of less-loader (6.0.0) by moving less-specific options (e.g. javascriptEnabled) to lessOptions

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true
        }
      }
    }
  }
}

Might be something to consider for PR https://github.com/vueComponent/ant-design-vue/pull/2150

The same vue.config.js file gave me compile errors when I updated less-loader to version 6.0.0, which had breaking changes (see 6.0.0 release note)

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      less: {
        javascriptEnabled: true
      }
    }
  }
}

You can make this work either by downgrading less-loader back to 5.0.0:

npm install --save-dev [email protected]

or by making your vue config work with the latest version of less-loader (6.0.0) by moving less-specific options (e.g. javascriptEnabled) to lessOptions

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true
        }
      }
    }
  }
}

Might be something to consider for PR #2150

you are right. buddy

The same vue.config.js file gave me compile errors when I updated less-loader to version 6.0.0, which had breaking changes (see 6.0.0 release note)

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      less: {
        javascriptEnabled: true
      }
    }
  }
}

You can make this work either by downgrading less-loader back to 5.0.0:

npm install --save-dev [email protected]

or by making your vue config work with the latest version of less-loader (6.0.0) by moving less-specific options (e.g. javascriptEnabled) to lessOptions

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true
        }
      }
    }
  }
}

Might be something to consider for PR #2150

yes,work,3q!

Was this page helpful?
0 / 5 - 0 ratings