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..6b6705d4f21cf 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.1", "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..9ddb6c9bf83a8 --- /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 +}