1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Improved with-ant-design example (#4034)

* Improved with-ant-design example

* standardjs fix maybe
This commit is contained in:
Luke Plaster 2018-03-23 19:52:34 +08:00 committed by Tim Neutkens
parent 9470b91ba1
commit a6af11c6ae
5 changed files with 20 additions and 11 deletions

View file

@ -6,7 +6,7 @@
"import", "import",
{ {
"libraryName": "antd", "libraryName": "antd",
"style": false "style": "css"
} }
] ]
] ]

View file

@ -4,7 +4,7 @@ export default ({ children }) =>
<Head> <Head>
<meta name='viewport' content='width=device-width, initial-scale=1' /> <meta name='viewport' content='width=device-width, initial-scale=1' />
<meta charSet='utf-8' /> <meta charSet='utf-8' />
<link rel='stylesheet' href='https://unpkg.com/antd@3/dist/antd.min.css' /> <link rel='stylesheet' href='/_next/static/style.css' />
</Head> </Head>
<style jsx global>{` <style jsx global>{`
body { body {

View file

@ -0,0 +1,8 @@
const withCss = require('@zeit/next-css')
// fix: prevents error when .css files are required by node
if (typeof require !== 'undefined') {
require.extensions['.css'] = (file) => {}
}
module.exports = withCss()

View file

@ -7,7 +7,8 @@
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"antd": "^3.0.2", "@zeit/next-css": "^0.1.4",
"antd": "^3.3.1",
"babel-plugin-import": "^1.1.1", "babel-plugin-import": "^1.1.1",
"next": "latest", "next": "latest",
"react": "^16.0.0", "react": "^16.0.0",