From 067bbeee9191f9ee631471ed527fa81bc66d06b9 Mon Sep 17 00:00:00 2001 From: viz Date: Tue, 3 Mar 2020 13:41:16 +0800 Subject: [PATCH 1/4] chore(deps): remove next-css --- examples/with-ant-design/.babelrc | 12 ----------- examples/with-ant-design/next.config.js | 28 ------------------------- examples/with-ant-design/package.json | 4 +--- examples/with-ant-design/pages/_app.js | 5 +++++ 4 files changed, 6 insertions(+), 43 deletions(-) delete mode 100755 examples/with-ant-design/.babelrc delete mode 100644 examples/with-ant-design/next.config.js create mode 100644 examples/with-ant-design/pages/_app.js diff --git a/examples/with-ant-design/.babelrc b/examples/with-ant-design/.babelrc deleted file mode 100755 index 53fbf1fcb2dc5..0000000000000 --- a/examples/with-ant-design/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": ["next/babel"], - "plugins": [ - [ - "import", - { - "libraryName": "antd", - "style": "css" - } - ] - ] -} diff --git a/examples/with-ant-design/next.config.js b/examples/with-ant-design/next.config.js deleted file mode 100644 index 11bb7ea8c50dc..0000000000000 --- a/examples/with-ant-design/next.config.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable */ -const withCss = require('@zeit/next-css') - -module.exports = withCss({ - webpack: (config, { isServer }) => { - if (isServer) { - const antStyles = /antd\/.*?\/style\/css.*?/ - const origExternals = [...config.externals] - config.externals = [ - (context, request, callback) => { - if (request.match(antStyles)) return callback() - if (typeof origExternals[0] === 'function') { - origExternals[0](context, request, callback) - } else { - callback() - } - }, - ...(typeof origExternals[0] === 'function' ? [] : origExternals), - ] - - config.module.rules.unshift({ - test: antStyles, - use: 'null-loader', - }) - } - return config - }, -}) diff --git a/examples/with-ant-design/package.json b/examples/with-ant-design/package.json index 95d01592c8624..5873979b671e3 100755 --- a/examples/with-ant-design/package.json +++ b/examples/with-ant-design/package.json @@ -8,10 +8,8 @@ }, "dependencies": { "@zeit/next-css": "^1.0.1", - "antd": "^3.9.2", - "babel-plugin-import": "^1.9.1", + "antd": "^4.0.0", "next": "latest", - "null-loader": "2.0.0", "react": "^16.7.0", "react-dom": "^16.7.0" }, diff --git a/examples/with-ant-design/pages/_app.js b/examples/with-ant-design/pages/_app.js new file mode 100644 index 0000000000000..c5a0837a5cdf2 --- /dev/null +++ b/examples/with-ant-design/pages/_app.js @@ -0,0 +1,5 @@ +import 'antd/dist/antd.css'; + +export default function MyApp({ Component, pageProps }) { + return +} \ No newline at end of file From f27804d52c8228861966db41dc538a60dc7b2a6c Mon Sep 17 00:00:00 2001 From: viz Date: Sat, 7 Mar 2020 02:50:18 +0800 Subject: [PATCH 2/4] Update examples/with-ant-design/package.json Co-Authored-By: Jack --- examples/with-ant-design/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-ant-design/package.json b/examples/with-ant-design/package.json index 5873979b671e3..6b6705d4f21cf 100755 --- a/examples/with-ant-design/package.json +++ b/examples/with-ant-design/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@zeit/next-css": "^1.0.1", - "antd": "^4.0.0", + "antd": "^4.0.1", "next": "latest", "react": "^16.7.0", "react-dom": "^16.7.0" From 44f3d319a4d878d05f775c31928d8864ad0ead97 Mon Sep 17 00:00:00 2001 From: viz Date: Sat, 7 Mar 2020 02:50:29 +0800 Subject: [PATCH 3/4] Update examples/with-ant-design/pages/_app.js Co-Authored-By: Jack --- examples/with-ant-design/pages/_app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/with-ant-design/pages/_app.js b/examples/with-ant-design/pages/_app.js index c5a0837a5cdf2..cc2d96f84845f 100644 --- a/examples/with-ant-design/pages/_app.js +++ b/examples/with-ant-design/pages/_app.js @@ -1,5 +1,5 @@ -import 'antd/dist/antd.css'; +import 'antd/dist/antd.min.css'; export default function MyApp({ Component, pageProps }) { return -} \ No newline at end of file +} From 4c83b3b54d89ea786985cbdb62afeee6f11d998c Mon Sep 17 00:00:00 2001 From: viz Date: Sat, 7 Mar 2020 11:52:28 +0800 Subject: [PATCH 4/4] chore(lint): fix a linting error --- examples/with-ant-design/pages/_app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-ant-design/pages/_app.js b/examples/with-ant-design/pages/_app.js index cc2d96f84845f..9ddb6c9bf83a8 100644 --- a/examples/with-ant-design/pages/_app.js +++ b/examples/with-ant-design/pages/_app.js @@ -1,4 +1,4 @@ -import 'antd/dist/antd.min.css'; +import 'antd/dist/antd.css' export default function MyApp({ Component, pageProps }) { return