alibaba / ice

🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)
https://ice.work
MIT License
17.8k stars 2.09k forks source link

ice3.js outputDir异常 #6916

Open wh1teYu opened 2 weeks ago

wh1teYu commented 2 weeks ago

Describe the bug

在ice.config.mts中,修改outputDir,改为相对路径

import { defineConfig } from '@ice/app';

// 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: false,
  server: {
    onDemand: true,
    format: 'esm',
  },
  publicPath: '/mall-view-pc',
  outputDir: '../../dist/mall-view-pc'
}));

打包报错

xxx@xxxxMac-Pro cairh-mall-repo % yarn build:mall-pc yarn run v1.22.19 $ lerna run --scope mall-pc build lerna notice cli v4.0.0 lerna notice filter including "mall-pc" lerna info filter [ 'mall-pc' ] lerna info Executing command in 1 package: "yarn run build" lerna ERR! yarn run build exited 1 in 'mall-pc' lerna ERR! yarn run build stdout: $ ice build

error Command failed with exit code 1. lerna ERR! yarn run build exited 1 in 'mall-pc' error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

希望打包正常

Actual behavior

No response

Version of ice.js

@ice/app 3.49

Content of build.json or ice.config.mts

import { defineConfig } from '@ice/app';

// 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: false,
  server: {
    onDemand: true,
    format: 'esm',
  },
  publicPath: '/mall-view-pc',
  outputDir: '../../dist/mall-view-pc'
}));

Additional context

No response

ClarkXia commented 2 weeks ago

产物最好还是在项目目录下,如果涉及最终移动位置的诉求,可以通过结束构建的 hooks 进行拷贝操作