mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
chore: remove babel-plugin-import warning (#37975)
* chore: remove babel-plugin-import warning * chore: update test case * chore: code clean
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const OLD_NODE_ENV = process.env.NODE_ENV;
|
||||
process.env.NODE_ENV = 'development';
|
||||
const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
const antd = require('..');
|
||||
|
||||
describe('antd', () => {
|
||||
@@ -11,11 +10,4 @@ describe('antd', () => {
|
||||
it('exports modules correctly', () => {
|
||||
expect(Object.keys(antd)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should hint when import all components in dev mode', () => {
|
||||
expect(warnSpy).toHaveBeenCalledWith(
|
||||
'You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.',
|
||||
);
|
||||
warnSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
/* @remove-on-es-build-begin */
|
||||
// this file is not used if use https://github.com/ant-design/babel-plugin-import
|
||||
const ENV = process.env.NODE_ENV;
|
||||
if (
|
||||
ENV !== 'production' &&
|
||||
ENV !== 'test' &&
|
||||
typeof console !== 'undefined' &&
|
||||
console.warn && // eslint-disable-line no-console
|
||||
typeof window !== 'undefined'
|
||||
) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
'You are using a whole package of antd, ' +
|
||||
'please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.',
|
||||
);
|
||||
}
|
||||
/* @remove-on-es-build-end */
|
||||
|
||||
export { default as Affix } from './affix';
|
||||
export type { AffixProps } from './affix';
|
||||
export { default as Alert } from './alert';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "antd",
|
||||
"version": "5.0.0-alpha.1",
|
||||
"version": "5.0.0-alpha.2",
|
||||
"description": "An enterprise-class UI design language and React components implementation",
|
||||
"title": "Ant Design",
|
||||
"keywords": [
|
||||
|
||||
Reference in New Issue
Block a user