1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export const resolveAssetsPath = (buildPath: string, serverName: string, assetsPath: string) => {
|
8 | const path = require('path');
|
9 |
|
10 | const resolvedPath = path.resolve(buildPath, serverName, assetsPath);
|
11 |
|
12 | return !resolvedPath.endsWith("/") ? resolvedPath+"/" : resolvedPath;
|
13 | };
|
14 |
|
15 |
|
16 | export const getStaticBucketName = (accountId: string, stackName: string, assetsPath: string | undefined, stage: string) => {
|
17 | return `infrcomp-${accountId}-${stackName}-${assetsPath !== undefined ? assetsPath+"-" : ""}${stage}`;
|
18 | }
|
19 |
|
20 |
|
21 | export const getBasename = () => {
|
22 |
|
23 |
|
24 | if (typeof window != 'undefined' && window.__BASENAME__) {
|
25 | return window.__BASENAME__;
|
26 |
|
27 |
|
28 |
|
29 | }
|
30 |
|
31 | return process.env.STAGE_PATH && process.env.STAGE_PATH !== "undefined" ?
|
32 | "/"+process.env.STAGE_PATH : "/";
|
33 | }; |
\ | No newline at end of file |