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

在umi项目里面怎么配置? #47

Open
xu-Aurora opened this issue Dec 9, 2020 · 16 comments
Open

在umi项目里面怎么配置? #47

xu-Aurora opened this issue Dec 9, 2020 · 16 comments

Comments

@xu-Aurora
Copy link

因为我umi项目里面没有config这个配置文件的。。。

@iamkun
Copy link
Collaborator

iamkun commented Dec 9, 2020

maybe you should look for something related to "how to add webpack plugin in umi"

@afc163
Copy link
Member

afc163 commented Dec 9, 2020

@iamkun 可以搞一个 umi 插件。

@iamkun
Copy link
Collaborator

iamkun commented Dec 9, 2020

@iamkun 可以搞一个 umi 插件。

也还真可以,有空我看下

@xu-Aurora
Copy link
Author

maybe you should look for something related to "how to add webpack plugin in umi"

image
在umi上配置了,还是不行

@milkyu
Copy link

milkyu commented Dec 14, 2020

umi 用户非常需要。急

@ghostg00
Copy link

同需要

@qhanw
Copy link

qhanw commented Dec 30, 2020

@iamkun 可以搞一个 umi 插件。

也还真可以,有空我看下

已经迫不及待了

@F-loat
Copy link
Contributor

F-loat commented Dec 31, 2020

暂时可以通过 chainWebpack 来新增插件

export default defineConfig({
  // ...
  chainWebpack(config) {
    config
      .plugin('antd-dayjs-webpack-plugin')
      .use('antd-dayjs-webpack-plugin')
      .end();
  }
});

@king-hcj
Copy link

king-hcj commented Feb 22, 2021

umi项目中可以通过 webpack-chain 的 API 修改 webpack 配置,详细用法参考umi chainwebpack

以下是具体配置代码:

const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');

export default {
 // ...
chainWebpack(config) {
    config.plugin('antd-dayjs-webpack-plugin').use(AntdDayjsWebpackPlugin);
  // 如果是antdv3,使用下面的配置
   // config.plugin('antd-dayjs-webpack-plugin').use(AntdDayjsWebpackPlugin, [{ preset: 'antdv3' }]);
 },
// ....
}

antdv3不预设会出现https://github.com/ant-design/antd-dayjs-webpack-plugin/issues/57的现象
@milkyu @qhanw

@king-hcj
Copy link

因为我umi项目里面没有config这个配置文件的。。。

#47 (comment)

@king-hcj
Copy link

umi 用户非常需要。急

#47 (comment)

@postbird
Copy link

umi项目中可以通过 webpack-chain 的 API 修改 webpack 配置,详细用法参考umi chainwebpack

以下是具体配置代码:

const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');

export default {
 // ...
chainWebpack(config) {
    config.plugin('antd-dayjs-webpack-plugin').use(AntdDayjsWebpackPlugin);
  // 如果是antdv3,使用下面的配置
   // config.plugin('antd-dayjs-webpack-plugin').use(AntdDayjsWebpackPlugin, [{ preset: 'antdv3' }]);
 },
// ....
}

antdv3不预设会出现https://github.com/ant-design/antd-dayjs-webpack-plugin/issues/57的现象
@milkyu @qhanw

请问如何引入中文语言包呢?发现这样子直接启用 无法使用中文语言包

@postbird
Copy link

umi项目中可以通过 webpack-chain 的 API 修改 webpack 配置,详细用法参考umi chainwebpack
以下是具体配置代码:

const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');

export default {
 // ...
chainWebpack(config) {
    config.plugin('antd-dayjs-webpack-plugin').use(AntdDayjsWebpackPlugin);
  // 如果是antdv3,使用下面的配置
   // config.plugin('antd-dayjs-webpack-plugin').use(AntdDayjsWebpackPlugin, [{ preset: 'antdv3' }]);
 },
// ....
}

antdv3不预设会出现https://github.com/ant-design/antd-dayjs-webpack-plugin/issues/57的现象
@milkyu @qhanw

请问如何引入中文语言包呢?发现这样子直接启用 无法使用中文语言包

发现直接在 umi 的 app.tsx 中引入 dayjs/locale/zh-cn 的语言包就行了

@lifegit
Copy link

lifegit commented Sep 9, 2021

开启 mfsu 报错,你们遇到了吗? #66

@cgfeel
Copy link

cgfeel commented Nov 12, 2021

开启 mfsu 报错,你们遇到了吗? #66

把cache全部删除,重新启动。。。。研究了一下午才发现发的。。。。

@lxy94
Copy link

lxy94 commented Oct 26, 2023

umi项目中可以通过 webpack-chain 的 API 修改 webpack 配置,详细用法参考umi chainwebpack
以下是具体配置代码:

const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');

export default {
 // ...
chainWebpack(config) {
    config.plugin('antd-dayjs-webpack-plugin').use(AntdDayjsWebpackPlugin);
  // 如果是antdv3,使用下面的配置
   // config.plugin('antd-dayjs-webpack-plugin').use(AntdDayjsWebpackPlugin, [{ preset: 'antdv3' }]);
 },
// ....
}

antdv3不预设会出现https://github.com/ant-design/antd-dayjs-webpack-plugin/issues/57的现象
@milkyu @qhanw

请问如何引入中文语言包呢?发现这样子直接启用 无法使用中文语言包

我用的v3,参数也配置了,还是出现日历全部展示同一个数字的现象

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

No branches or pull requests