esa-pcg-cli 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -26
- package/dist/_inline-overrides.js +2 -2
- package/dist/_protocol/types.d.ts +3 -0
- package/dist/_protocol/types.js +1 -1
- package/dist/adapters/wrappers/node-server.d.ts +1 -1
- package/dist/adapters/wrappers/node-server.js +8 -6
- package/dist/commands/build.js +20 -60
- package/dist/commands/serve.js +2 -2
- package/dist/overrides/tagCache/gateway.d.ts +3 -0
- package/dist/overrides/tagCache/gateway.js +26 -1
- package/dist/runtime/cdn-purge.d.ts +49 -0
- package/dist/runtime/cdn-purge.js +237 -0
- package/dist/runtime/image-config.d.ts +45 -0
- package/dist/runtime/image-config.js +144 -0
- package/dist/runtime/image-proxy.d.ts +3 -2
- package/dist/runtime/image-proxy.js +18 -3
- package/package.json +2 -3
- package/runtime/pcg-image-loader.js +0 -13
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Shipped with esa-pcg-cli. `pcg build` copies this file into
|
|
2
|
-
// <projectDir>/node_modules/.pcg/, so next.config can reference it as
|
|
3
|
-
// 'node_modules/.pcg/pcg-image-loader.js' without writing into the user's
|
|
4
|
-
// source tree and without declaring esa-pcg-cli in package.json.
|
|
5
|
-
// 图片请求走同域 /_pcg/image/optimize,由 FC 内的 wrapper 拦截后用签名 client 调 Gateway。
|
|
6
|
-
export default function pcgImageLoader({ src, width, quality }) {
|
|
7
|
-
const params = new URLSearchParams({
|
|
8
|
-
url: src,
|
|
9
|
-
w: String(width),
|
|
10
|
-
q: String(quality || 75),
|
|
11
|
-
});
|
|
12
|
-
return `/_pcg/image/optimize?${params}`;
|
|
13
|
-
}
|