Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

antd-dayjs-webpack-plugin对于路由的影响 #7

Closed
Lpbzzz opened this issue Jan 10, 2020 · 5 comments
Closed

antd-dayjs-webpack-plugin对于路由的影响 #7

Lpbzzz opened this issue Jan 10, 2020 · 5 comments

Comments

@Lpbzzz
Copy link

Lpbzzz commented Jan 10, 2020

感觉很奇妙:
create-react-app 安装antdesign ,用 react-app-rewired 添加插件,config-overrides.js中配置addWebpackPlugin( new AntdDayjsWebpackPlugin() ) 会导致:npm run start 的默认页面停留在http://localhost:3000/ , 不会自动转到http://localhost:3000/#/ 。去掉插件就没问题了。。。

@iamkun
Copy link
Collaborator

iamkun commented Jan 10, 2020

可以关注 arackaf/customize-cra#204
怀疑是 addWebpackPlugin 的锅

@wkl007
Copy link

wkl007 commented Jan 14, 2020

同样出现这个问题,添加了这个插件页面白屏,得f5刷新一下页面才能看到页面,删除掉这个插件就没问题了...,而且我没有使用customize-cra这个插件,直接yarn eject之后修改webpack.config.js文件添加的antd-dayjs-webpack-plugin插件

@laoqiu
Copy link

laoqiu commented Apr 10, 2020

同样出现这个问题,不管create-react-app用rewired还是eject都一样,而且还无法替换moment

"devDependencies": {
"antd-dayjs-webpack-plugin": "^1.0.0",
"babel-plugin-import": "^1.13.0",
"customize-cra": "^0.9.1",
"prerender-spa-plugin": "^3.4.0",
"react-app-rewired": "^2.1.5",
"react-dev-utils": "^10.2.1",
"react-scripts": "^3.4.1"
}

@Lpbzzz
Copy link
Author

Lpbzzz commented Apr 24, 2020

我发现我错误使用了require.context 这个api,导致路由也会失效。至于dayjs,后来没用了,也暂时没办法验证了。

@Lpbzzz Lpbzzz closed this as completed Apr 24, 2020
@qld-cf
Copy link

qld-cf commented Jan 19, 2021

  • 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants