File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ function formatScriptSrcToUrl(scriptSrc) {
2323 // 比如可能会是一个TrustedScriptURL
2424 scriptSrc = scriptSrc + "" ;
2525
26+ // 正常格式直接返回
27+ if ( scriptSrc . startsWith ( "http://" ) || scriptSrc . startsWith ( "https://" ) ) {
28+ return scriptSrc ;
29+ }
30+
2631 // 兼容CDN URL
2732 // 示例:"//statics.moonshot.cn/kimi-chat/shared-K0TvIN461soURJCs7nh6uxcQiCM_.04bc3959.async.js"
2833 if ( scriptSrc . startsWith ( "//" ) ) {
@@ -40,7 +45,9 @@ function formatScriptSrcToUrl(scriptSrc) {
4045 return window . location . origin + scriptSrc ;
4146 }
4247
43- return scriptSrc ;
48+ // 相对路径
49+ // "static/js/chunk-19a101ae.45e69b5c.js"
50+ return window . location . origin + "/" + scriptSrc ;
4451}
4552
4653module . exports = {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ module.exports = env => {
77 return merge ( common , {
88 mode : "none" ,
99 //开启这个可以在开发环境中调试代码
10- devtool : "source-map" ,
10+ // devtool: "source-map",
1111 devServer : {
1212 static : false ,
1313 allowedHosts : "all" ,
You can’t perform that action at this time.
0 commit comments