chore(deps): remove next-css from examples/antd (#10804)

* chore(deps): remove next-css

* Update examples/with-ant-design/package.json

Co-Authored-By: Jack <jacklee82814@gmail.com>

* Update examples/with-ant-design/pages/_app.js

Co-Authored-By: Jack <jacklee82814@gmail.com>

* chore(lint): fix a linting error

Co-authored-by: Jack <jacklee82814@gmail.com>
This commit is contained in:
viz 2020-04-07 22:40:11 +08:00 committed by GitHub
parent 1eefd006a8
commit 9f27259425
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 43 deletions

View file

@ -1,12 +0,0 @@
{
"presets": ["next/babel"],
"plugins": [
[
"import",
{
"libraryName": "antd",
"style": "css"
}
]
]
}

View file

@ -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
},
})

View file

@ -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"
},

View file

@ -0,0 +1,5 @@
import 'antd/dist/antd.css'
export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}