From ea64ba76ecca71749c320637d9298a45a9b31058 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 4 Nov 2019 16:46:23 +0800 Subject: [PATCH] cdn --- public/react/scripts/readme-cdn.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 public/react/scripts/readme-cdn.txt diff --git a/public/react/scripts/readme-cdn.txt b/public/react/scripts/readme-cdn.txt new file mode 100644 index 000000000..7d090ee7a --- /dev/null +++ b/public/react/scripts/readme-cdn.txt @@ -0,0 +1,16 @@ +目前是判断域名的方式动态访问对应的cdn资源 +静态资源处理在build.js中,如下代码: +if (window.location.host == 'pre-newweb.educoder.net') { + _host = 'https://testali-cdn.educoder.net/react/build/' +} else if (window.location.host == 'www.educoder.net') { + _host = 'https://ali-cdn.educoder.net/react/build/' +} + +只对预上线和正式版做了处理 + +动态的chunk资源处理在public-path.js中,如下代码: +if ( window.location.host == 'pre-newweb.educoder.net') { + __webpack_public_path__ = 'https://testali-cdn.educoder.net/react/build/' +} else if ( window.location.host == 'www.educoder.net') { + __webpack_public_path__ = 'https://ali-cdn.educoder.net/react/build/' +} \ No newline at end of file