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

assets-manifest.json 生成相关错误 #7034

Open
YSMJ1994 opened this issue Dec 10, 2024 · 2 comments
Open

assets-manifest.json 生成相关错误 #7034

YSMJ1994 opened this issue Dec 10, 2024 · 2 comments
Labels

Comments

@YSMJ1994
Copy link

YSMJ1994 commented Dec 10, 2024

Describe the bug

错误1: 当插件配置多任务构建时,两个任务生成的 assets-manifest.json 文件名相同,会相互覆盖,且无法通过配置调整文件名
错误2: 手动在 plugin 内设置 assetsManifest = false,构建报错,错误位置发生在 ServerRunnerPluginServerCompilerPlugin

Expected behavior

  1. 可以手动指定 assets-manifest.json 文件名,或者默认将多任务生成的 manifest 合并起来
  2. 配置 assetsManifest = false 能正常构建

Actual behavior

No response

Version of ice.js

3.5.1

Content of build.json or ice.config.mts

import { defineConfig } from '@ice/app';
import type { Plugin } from '@ice/app/types';
import def from '@ali/ice-plugin-def';

const myPlugin: Plugin = () => {
  return {
    name: 'test',
    setup(api) {
      // 问题1: 多个任务间生成的 assets-manifest.json 相互覆盖
      api.registerTask('custom', {
        entry: {
          custom: './src/pages/index',
        },
      });
      // 问题2: 配置 assetsManifest = false 构建错误
      // api.onGetConfig(config => {
      //   config.assetsManifest = false;
      // });
    },
  };
};

// The project config, see https://v3.ice.work/docs/guide/basic/config
const minify = process.env.NODE_ENV === 'production' ? 'swc' : false;
export default defineConfig(() => ({
  // Set your configs here.
  minify,
  server: {
    onDemand: true,
    format: 'esm',
  },
  plugins: [def(), myPlugin()],
}));

Additional context

No response

@YSMJ1994 YSMJ1994 added the bug label Dec 10, 2024
@YSMJ1994
Copy link
Author

使用 npm create ice ice-app 新建项目加上上述 ice.config.mts 内容即可复现问题

@ClarkXia
Copy link
Collaborator

多任务下的确会有这个问题,目前多任务是希望构建那里两端? 理论上 assets-manifest 仅用于 web 产物消费

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants