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:
parent
1eefd006a8
commit
9f27259425
4 changed files with 6 additions and 43 deletions
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"presets": ["next/babel"],
|
||||
"plugins": [
|
||||
[
|
||||
"import",
|
||||
{
|
||||
"libraryName": "antd",
|
||||
"style": "css"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
|
@ -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
|
||||
},
|
||||
})
|
|
@ -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"
|
||||
},
|
||||
|
|
5
examples/with-ant-design/pages/_app.js
Normal file
5
examples/with-ant-design/pages/_app.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import 'antd/dist/antd.css'
|
||||
|
||||
export default function MyApp({ Component, pageProps }) {
|
||||
return <Component {...pageProps} />
|
||||
}
|
Loading…
Reference in a new issue