umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.3k stars 2.65k forks source link

[Bug] 使用webpack-assets-manifest插件时运行yarn start报错 #11948

Closed JarvisArt closed 9 months ago

JarvisArt commented 9 months ago

What happens?

image

image

Mini Showcase Repository(REQUIRED)

import { defineConfig } from '@umijs/max';
import WebpackAssetsManifest from 'webpack-assets-manifest';
import routes from './routes';

export default defineConfig({
  antd: {},
  access: {},
  model: {},
  initialState: {},
  request: {},
  routes,
  npmClient: 'yarn',
  manifest: false,
  chainWebpack(memo) {
    memo.plugin('webpack-assets-manifest').use(
      new WebpackAssetsManifest({
        output: '../assets/asset-manifest.json',
        writeToDisk: true,
        entrypoints: true,
        entrypointsUseAssets: true,
      }),
    );
  }
});

Please provide a minimal reproduction then upload to your GitHub. 请提供 最小重现,并上传到你的 GitHub 仓库

How To Reproduce

Steps to reproduce the behavior: 1. 2.

Expected behavior 1. 2.

Context

fz6m commented 9 months ago
   memo.plugin('assets-manifest-plugin').use(
      require('webpack-assets-manifest'),
      [{ ...options }]
   );