Open meowwww88hen opened 2 years ago
一样的问题
me too
After spending more than a week to fix the error (I almost give up), I found the solution here: https://github.com/arackaf/customize-cra/issues/315#issuecomment-1017081592
TLDR - add the following lines in config-overrides.js
:
const { override, fixBabelImports, addLessLoader, adjustStyleLoaders } = require('customize-cra');
module.exports = override(
// Load antd
fixBabelImports('import', { ... }),
// Add `javascriptEnabled` and antd theme configuration
// to the Less loader
addLessLoader({ ... }),
adjustStyleLoaders(({ use: [, , postcss] }) => {
const postcssOptions = postcss.options;
postcss.options = { postcssOptions };
})
);
After spending more than a week to fix the error (I almost give up), I found the solution here: arackaf/customize-cra#315 (comment)
TLDR - add the following lines in
config-overrides.js
:const { override, fixBabelImports, addLessLoader, adjustStyleLoaders } = require('customize-cra'); module.exports = override( // Load antd fixBabelImports('import', { ... }), // Add `javascriptEnabled` and antd theme configuration // to the Less loader addLessLoader({ ... }), adjustStyleLoaders(({ use: [, , postcss] }) => { const postcssOptions = postcss.options; postcss.options = { postcssOptions }; }) );
This works for me! Thanks, dude, it is a very helpful answer.
Guys, please I'm new to coding and don't know how to implement this in my code. Please can anyone help me further
After spending more than a week to fix the error (I almost give up), I found the solution here: arackaf/customize-cra#315 (comment)
TLDR - add the following lines in
config-overrides.js
:const { override, fixBabelImports, addLessLoader, adjustStyleLoaders } = require('customize-cra'); module.exports = override( // Load antd fixBabelImports('import', { ... }), // Add `javascriptEnabled` and antd theme configuration // to the Less loader addLessLoader({ ... }), adjustStyleLoaders(({ use: [, , postcss] }) => { const postcssOptions = postcss.options; postcss.options = { postcssOptions }; }) );
It's very useful!! Thanks for your help!
encountered same problem, after I deleted below config in vue.config.js, it worked: css: {, loaderOptions: { postcss: { plugins: [ require("postcss-pxtorem")({ rootValue: 14, propList: ["*"], }), ], }, }, },
有人遇到同样的问题吗?