We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to custom ant design theme by its document(https://ant.design/docs/react/customize-theme), here is:
If you import styles by specifying the style option of babel-plugin-import, change it from css to true, which will import the less version of antd.
babel-plugin-import
css
true
so I change the .babelrc ["import", { libraryName: "antd", style: true }]],
.babelrc
["import", { libraryName: "antd", style: true }]],
then I modify the less-loader of webpack.config.js, so I can use modifyVars to custome my theme
less-loader
webpack.config.js
modifyVars
loaders: { less: { enable: true, test: /\.less/, loader: 'less-loader', options: { javascriptEnabled: true, modifyVars: {'primary-color': '#1DA57A'} } } },
however, it doesn't work, here is error messages:
2018-04-22 10:09:57,802 ERROR 57327 [-/10.183.76.232/-/232ms GET /] nodejs.SyntaxError: Invalid or unexpected token (function (exports, require, module, __filename, __dirname) { @import "./themes/default"; ^ SyntaxError: Invalid or unexpected token at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:607:28) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object.<anonymous> (/Users/anonymous/projects/egg-react/node_modules/antd/lib/layout/style/index.js:3:1) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17)
Any help would be appreciated!
The text was updated successfully, but these errors were encountered:
@sukechris Hi, were you able to solve this issue?
Sorry, something went wrong.
No branches or pull requests
I want to custom ant design theme by its document(https://ant.design/docs/react/customize-theme), here is:
so I change the
.babelrc
["import", { libraryName: "antd", style: true }]],
then I modify the
less-loader
ofwebpack.config.js
, so I can usemodifyVars
to custome my themehowever, it doesn't work, here is error messages:
Any help would be appreciated!
The text was updated successfully, but these errors were encountered: