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

请教下【build-plugin-component】 onGetWebpackConfig 不执行,提示 No webpack config found #388

Open
hm496 opened this issue Aug 29, 2022 · 2 comments

Comments

@hm496
Copy link

hm496 commented Aug 29, 2022

请教下, onGetWebpackConfig 不执行?应该如何修改 webpack 配置,想增加新的loader
提示 WARN CONFIG No webpack config found.

    "build-plugin-component": "^1.11.0",
    "build-scripts": "^1.3.0",
    "jest": "^26.4.2",
    "webpack": "^4.43.0",
    "webpack-dev-server": "^3.11.3"
// build.json 文件内容

{
  "externals": {
    "react": "var window.React",
    "react-dom": "var window.ReactDOM",
  },
  "plugins": [
    "build-plugin-component",
    "./build.plugin.js"
  ]
}

// build.plugin.js 文件内容
module.exports = ({ onGetWebpackConfig }) => {
  onGetWebpackConfig((config) => {
   // 这里为啥不执行?
    console.log('---------');
    console.log('---------');
    console.log('---------');
  });
};
@yizhifeimao
Copy link

我也遇到了这个问题,请问解决了吗

@luhc228
Copy link
Member

luhc228 commented Feb 9, 2023

请提供最小可复现 demo

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

3 participants