alibaba / ice

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

ice3.x中解析三方包资源路径失败 #6809

Closed mafx1024 closed 4 months ago

mafx1024 commented 5 months ago

Describe the bug

在@ice/app: 3.4.3版本中,通过 npm run start,三方包引入资源报错报错: image 三方包地址:https://github.com/ajaxorg/ace-builds/blob/v1.32.6/src-noconflict/ace.js#L370 版本@ice/app: 3.0.0 表现正常

Expected behavior

不报错

Actual behavior

报错

Version of ice.js

3.x

Content of build.json or ice.config.mts

import def from '@ali/ice-plugin-def';
import { defineConfig } from '@ice/app';
import auth from '@ice/plugin-auth';
import request from '@ice/plugin-request';
import store from '@ice/plugin-store';

import proxyConfig from './src/config';

// The project config, see https://v3.ice.work/docs/guide/basic/config
const minify = process.env.NODE_ENV === 'production' ? 'swc' : false;

export default defineConfig(() => ({
  ssg: false,
  minify,
  codeSplitting: 'page',
  compileDependencies: false,
  sourceMap: true,
  plugins: [request(), store(), auth(), def()],
  webpack: (config) => {
    if (process.env.NODE_ENV === 'production') {
      config.cache = {
        // cacheDirectory  可配置缓存路径
        type: 'filesystem',
        compression: 'gzip',
        buildDependencies: {
          config: ['./ice.config.mts'],
        },
      };
    }

    return config;
  },
  proxy: {
    '/api': {
      target: proxyConfig.default.api,
      changeOrigin: true,
      secure: false,
    },
  },
}));

Additional context

No response

ClarkXia commented 4 months ago

清提供下三方包的源码使用方式

mafx1024 commented 4 months ago

@ice/app: 3.4.4 版本已修复