Skip to content

Commit

Permalink
Fix with antd ssg (#13611)
Browse files Browse the repository at this point in the history
Closes #12664 
Closes #13604 

The culprit was not only changing the library directory, but also having the icons version past 4.0.6. Also, the components which used the library had to be adjusted according to the new changes.

Confirmed that it works both in production and development. Confirmed that it builds on dev and production.

![Alt Text](https://media.giphy.com/media/dZ46aA1Rs7Oi1wSQKU/giphy.gif)
  • Loading branch information
todortotev authored Jun 1, 2020
1 parent 7d038df commit 795d931
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions examples/with-ant-design/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"import",
{
"libraryName": "antd",
"libraryDirectory": "es",
"libraryDirectory": "lib",
"style": "index.css"
}
],
[
"import",
{
"libraryName": "@ant-design/icons",
"libraryDirectory": "es/icons",
"libraryDirectory": "lib/icons",
"camel2DashComponentName": false
},
"@ant-design/icons"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-ant-design/components/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* webpack plugin fixes that bug.
*/
import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs'
import generatePicker from 'antd/es/date-picker/generatePicker'
import generatePicker from 'antd/lib/date-picker/generatePicker'

const DatePicker = generatePicker(dayjsGenerateConfig)

Expand Down
22 changes: 12 additions & 10 deletions examples/with-ant-design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
"name": "with-ant-design",
"version": "1.0.0",
"scripts": {
"dev": "cross-env NODE_OPTIONS=\"-r esm\" next",
"build": "cross-env NODE_OPTIONS=\"-r esm\" next build",
"analyze": "cross-env-shell NODE_OPTIONS=\"-r esm\" ANALYZE=true next build",
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@ant-design/icons": "^4.0.6",
"@ant-design/icons": "4.2.1",
"@next/bundle-analyzer": "^9.1.4",
"antd": "4.1.2",
"antd": "4.3.0",
"babel-plugin-import": "1.13.0",
"cross-env": "^7.0.2",
"dayjs": "1.8.24",
"dayjs": "1.8.28",
"esm": "^3.2.25",
"next": "9.3.4",
"next": "latest",
"postcss-preset-env": "^6.7.0",
"react": "16.13.1",
"react-dom": "16.13.1"
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"license": "ISC"
"browser": {
"fs": false,
"path": false
}
}

0 comments on commit 795d931

Please sign in to comment.