1. 项目里创建文件debug.js

      1. const webpack = require('webpack');
      2. const config = require('./webpack.config.js')// 读取配置文件
      3. const compiler = webpack(config);
      4. debugger
      5. function compilerCallback(err,stats){
      6. const statsString = stats.toString()
      7. console.log('statsString',statsString)
      8. }
      9. compiler.run((err,stats)=>{
      10. compilerCallback(err,stats)
      11. });
    2. 执行该文件即可。