rigjs 2.0.13 → 2.0.17
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/built/index.js +93 -93
- package/lib/build/index.ts +2 -0
- package/lib/classes/cicd/Deploy/AliDeploy.ts +8 -3
- package/package.json +1 -1
package/lib/build/index.ts
CHANGED
|
@@ -55,6 +55,8 @@ export default async (cmd: any) => {
|
|
|
55
55
|
}
|
|
56
56
|
console.log('exec build:', ep, ep.build, ep.defines);
|
|
57
57
|
shell.exec(ep.build);
|
|
58
|
+
ep.defines['__DEPLOY_DIR__'] = ep.deployDir;
|
|
59
|
+
ep.defines['__PUBLIC_PATH__'] = ep.publicPath;
|
|
58
60
|
replaceDefine(path.join(cicd.source.root_path, ep.dir), ep.defines);
|
|
59
61
|
}
|
|
60
62
|
}catch (e) {
|
|
@@ -2,6 +2,7 @@ import aliOSS from 'ali-oss';
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { DeployTarget } from '../CICD';
|
|
4
4
|
import os from 'os';
|
|
5
|
+
import path from 'path';
|
|
5
6
|
|
|
6
7
|
class AliOSS {
|
|
7
8
|
ossClient: aliOSS;
|
|
@@ -52,9 +53,13 @@ class AliOSS {
|
|
|
52
53
|
contentLength: fs.statSync(filesList[i]).size,
|
|
53
54
|
};
|
|
54
55
|
if (filesList[i].includes('index.html')) {
|
|
55
|
-
options =
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
options.headers = { 'Cache-Control': 'no-cache', Expires: -1 };
|
|
57
|
+
} else if (
|
|
58
|
+
path.extname(filesList[i]) === '.js' ||
|
|
59
|
+
path.extname(filesList[i]) === '.css' ||
|
|
60
|
+
path.extname(filesList[i]) === '.ico'
|
|
61
|
+
) {
|
|
62
|
+
options.headers = { 'Cache-Control': 'max-age=3000000' };
|
|
58
63
|
}
|
|
59
64
|
const fileResult = await this.ossClient.putStream(
|
|
60
65
|
ossPath,
|
package/package.json
CHANGED