{"id":1321,"date":"2023-03-18T12:05:47","date_gmt":"2023-03-18T04:05:47","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1321"},"modified":"2023-04-29T09:11:28","modified_gmt":"2023-04-29T01:11:28","slug":"case-sensitive-issue-in-deploying-ant-design-pro-under-linux","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/18\/case-sensitive-issue-in-deploying-ant-design-pro-under-linux\/","title":{"rendered":"Linux\u4e0b\u90e8\u7f72ant-design-pro\u5927\u5c0f\u5199\u654f\u611f\u95ee\u9898"},"content":{"rendered":"<h2>\u73b0\u8c61\u63cf\u8ff0<\/h2>\n<p>\u5728Mac\u548cWin\u4e0a\u6253\u5305\u6ca1\u95ee\u9898\uff0c\u653e\u5230Centos\u4e0b\u6253\u5305\u62a5\u9519\uff1a<\/p>\n<p><!-- more --><\/p>\n<pre><code>$ yarn build\nyarn run v1.19.1\n$ umi build\n\n\u2716 Webpack\n  Compiled with some errors in 1.05m\n\n ERROR  Failed to compile with 1 errors                                                                                                                                                               11:06:50 AM\n\nThis relative module was not found:\n\n* ..\/User\/resetPwd in .\/src\/pages\/.umi-production\/router.js\n\n ERROR CODE  ERR_WEBPACK_MODULE_NOT_FOUND\n\n DETAILS\n\n## Possible Reasons\n\n    1. The file does not exist\n    2. Case problem\n\nIf the build under mac is successful and the build fails under linux or on the cloud build platform, it must be case problem.\n\n## Solution\n\nIf it is a case, please double check that the import or require file and the target file are in the same case.\n\nerror Command failed with exit code 1.\ninfo Visit https:\/\/yarnpkg.com\/en\/docs\/cli\/run for documentation about this command.<\/code><\/pre>\n<h2>\u95ee\u9898\u89e3\u51b3<\/h2>\n<p>\u6587\u4ef6\u5f15\u7528\u5927\u5c0f\u5199\u95ee\u9898<\/p>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/ant-design\/ant-design-pro\/issues\/2267\">https:\/\/github.com\/ant-design\/ant-design-pro\/issues\/2267<\/a><\/p>\n<h3>case-sensitive-paths \u63d2\u4ef6\u68c0\u6d4b\u8def\u5f84\u5927\u5c0f\u5199\u95ee\u9898<\/h3>\n<ol>\n<li>\u6dfb\u52a0 webpack \u5f3a\u5236\u6587\u4ef6\u540d\u5927\u5c0f\u5199\u5339\u914d\u7684\u63d2\u4ef6<\/li>\n<\/ol>\n<pre><code>yarn add case-sensitive-paths-webpack-plugin --dev<\/code><\/pre>\n<ol start=\"2\">\n<li>\u6dfb\u52a0\u914d\u7f6e<code>config\/plugin.config.js<\/code><\/li>\n<\/ol>\n<pre><code class=\"language-javascript\">import CaseSensitivePathsPlugin from &#039;case-sensitive-paths-webpack-plugin&#039;;\n\nconfig.plugin(&#039;case-sensitive-paths&#039;).use(CaseSensitivePathsPlugin, [\n  {\n    debug: true,\n  },\n])<\/code><\/pre>\n<ol start=\"3\">\n<li>\u542f\u52a8\u5f00\u53d1\u670d\u52a1\uff0c\u63d2\u4ef6\u4f1a\u68c0\u67e5\u6587\u4ef6\u540d\u5927\u5c0f\u5199\u5e76\u7ed9\u51fa\u9519\u8bef\u63d0\u9192<\/li>\n<\/ol>\n<pre><code>yarn start<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u8c61\u63cf\u8ff0 \u5728Mac\u548cWin\u4e0a\u6253\u5305\u6ca1\u95ee\u9898\uff0c\u653e\u5230Centos\u4e0b\u6253\u5305\u62a5\u9519\uff1a $ yarn build yarn ru [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[288],"tags":[287],"class_list":["post-1321","post","type-post","status-publish","format-standard","hentry","category-ant-design","tag-antd"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1321"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1321\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}