ice-lab / build-scripts

:octopus: 基于 Webpack 的插件化工程构建工具,支持快速建设一套开箱即用的工程方案。
MIT License
396 stars 75 forks source link

# 请教下 onGetWebpackConfig 不执行,提示 No webpack config found #108

Closed hm496 closed 2 years ago

hm496 commented 2 years ago

请教下,为什么 onGetWebpackConfig 不执行? 提示 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('---------');
  });
};
jinggk commented 2 years ago

怎么解决的?