未验证 提交 9f272594 编写于 作者: V viz 提交者: GitHub

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

* chore(deps): remove next-css

* Update examples/with-ant-design/package.json
Co-Authored-By: NJack <jacklee82814@gmail.com>

* Update examples/with-ant-design/pages/_app.js
Co-Authored-By: NJack <jacklee82814@gmail.com>

* chore(lint): fix a linting error
Co-authored-by: NJack <jacklee82814@gmail.com>
上级 1eefd006
{
"presets": ["next/babel"],
"plugins": [
[
"import",
{
"libraryName": "antd",
"style": "css"
}
]
]
}
/* 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"
},
......
import 'antd/dist/antd.css'
export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册