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

RFC: externals支持函数 或者 正则表达式 #1747

Open
flgame opened this issue Jan 8, 2025 · 0 comments
Open

RFC: externals支持函数 或者 正则表达式 #1747

flgame opened this issue Jan 8, 2025 · 0 comments

Comments

@flgame
Copy link

flgame commented Jan 8, 2025

externals不支持函数 或者 正则表达式,原来忽略antd 样式文件的代码无效。
如:https://www.webpackjs.com/configuration/externals/#function

const antdStyle = /^antd\/.*(\/style|\.css|\.less|\.sass|\.scss)/;
const antdTheme = ({ request }: any, callback: any) => {
  if (antdStyle.test(request)) {
    return callback(null, '{}');
  }
  return callback();
};

也可用于解决antd样式覆盖问题,希望能够支持,谢谢!

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

1 participant