no message
This commit is contained in:
@@ -96,6 +96,28 @@ const base = {
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
},
|
||||
proxy: (() => {
|
||||
const remote = process.env.UNITY_CDN_REMOTE || 'https://oss.eanic.cn/001_code_cocos_res_20260616';
|
||||
const proxyPrefix = process.env.UNITY_CDN_DEV_PROXY || '/cdn-unity';
|
||||
let origin;
|
||||
let pathname;
|
||||
try {
|
||||
const u = new URL(remote);
|
||||
origin = u.origin;
|
||||
pathname = u.pathname.replace(/\/$/, '');
|
||||
} catch (e) {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
[proxyPrefix]: {
|
||||
target: origin,
|
||||
pathRewrite: {[proxyPrefix]: pathname},
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
logLevel: 'warn'
|
||||
}
|
||||
};
|
||||
})(),
|
||||
// 自定义请求头
|
||||
before: function (app, server) {
|
||||
|
||||
@@ -412,7 +434,10 @@ module.exports = [
|
||||
patterns: [
|
||||
{
|
||||
from: 'static',
|
||||
to: ''
|
||||
to: '',
|
||||
globOptions: {
|
||||
ignore: process.env.UNITY_CDN_PURE ? ['**/unity/**'] : []
|
||||
}
|
||||
}
|
||||
]
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user