GithubHelp home page GithubHelp logo

Comments (6)

yutingzhao1991 avatar yutingzhao1991 commented on June 14, 2024

嗯,有道理。应该是可以支持自定义。

// 构建时配置
request: {
  antd: false,
}

然后可以在运行时自定义错误处理:

// app.ts
const request = {
  errorMessageHandler: () => {},
};

感兴趣来个 PR 吗?

from plugins.

williamnie avatar williamnie commented on June 14, 2024

嗯,有道理。应该是可以支持自定义。

// 构建时配置
request: {
  antd: false,
}

然后可以在运行时自定义错误处理:

// app.ts
const request = {
  errorMessageHandler: () => {},
};

感兴趣来个 PR 吗?

有兴趣,哈哈,我看看能不能写出来,擅长写不正经的代码🤣,

from plugins.

williamnie avatar williamnie commented on June 14, 2024

嗯,有道理。应该是可以支持自定义。

// 构建时配置
request: {
  antd: false,
}

然后可以在运行时自定义错误处理:

// app.ts
const request = {
  errorMessageHandler: () => {},
};

感兴趣来个 PR 吗?

尴尬的是,我不会写ts🤣

from plugins.

feibi avatar feibi commented on June 14, 2024

确实应该去掉antd依赖

from plugins.

baranwang avatar baranwang commented on June 14, 2024

我试图用 alias 方法解决这个问题

  alias: {
    'antd/es/message': path.resolve(__dirname, './src/empty.js'),
    'antd/es/message/style': path.resolve(__dirname, './src/empty.js'),
    'antd/es/notification': path.resolve(__dirname, './src/empty.js'),
    'antd/es/notification/style': path.resolve(__dirname, './src/empty.js'),
  },

不过两个 style 部分不知道为什么没有效果

from plugins.

baranwang avatar baranwang commented on June 14, 2024

暂时用了一个比较脏的方法,把 postinstall 钩子换个一个 shell

mkdir -p ./node_modules/antd/es/message
echo 'module.exports = {}' | tee -a ./node_modules/antd/es/message/index.js ./node_modules/antd/es/message/style.js
mkdir -p ./node_modules/antd/es/notification
echo 'module.exports = {}' | tee -a ./node_modules/antd/es/notification/index.js ./node_modules/antd/es/notification/style.js

npx umi generate tmp

from plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.