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

how to enable less-loader to process .less file? like use 'react-app-rewire-less'? #28

Closed
pengqinppp opened this issue Nov 5, 2018 · 3 comments

Comments

@pengqinppp
Copy link

No description provided.

@arackaf
Copy link
Owner

arackaf commented Nov 5, 2018

You’ll need to send a PR modifying the webpack config to add a less loader - sorry, I’ve never used LESS before - not sure what that’d look like.

@arackaf arackaf closed this as completed Nov 5, 2018
@pengqinppp
Copy link
Author

pengqinppp commented Nov 5, 2018

config antd-mobile, theme use rewireLess:

const rewireLess = require('react-app-rewire-less')
const theme = require('./package.json').theme

const lessLoader = (loaderOptions) => (config, env) => {
  config = rewireLess.withLoaderOptions(loaderOptions)(config, env)
  return config
}

module.exports = override(
addDecoratorsLegacy(),
disableEsLint(),
useBabelRc(),
lessLoader({
    modifyVars: theme,
    javascriptEnabled: true
  })
);

@arackaf
Copy link
Owner

arackaf commented Nov 5, 2018

Are you asking or telling me that that’ll work? If asking, no idea. If that does in fact work, then shoot me a PR and I’ll get it added!

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