@realsee/five 5.0.0-alpha.13 → 5.0.0-alpha.130
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 +21 -11
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +134 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/{images/icons.png → icons.png} +0 -0
- package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1413 -0
- package/docs/assets/{images/widgets.png → widgets.png} +0 -0
- package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
- package/docs/classes/five.AnimationFrameLoop.html +15 -0
- package/docs/classes/five.BVH.html +10 -0
- package/docs/classes/five.BVHIntersect.html +1 -0
- package/docs/classes/five.BVHNode.html +7 -0
- package/docs/classes/five.BVHVector3.html +1 -0
- package/docs/classes/five.Camera.html +11 -0
- package/docs/classes/five.Five.html +303 -0
- package/docs/classes/five.InternalWebGLRenderer.html +1 -0
- package/docs/classes/five.IntersectMesh.html +1 -0
- package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
- package/docs/classes/five.Model.html +87 -0
- package/docs/classes/five.NetworkSubscribe.html +50 -0
- package/docs/classes/five.PBMContainer.html +17 -0
- package/docs/classes/five.PBMGroup.html +19 -0
- package/docs/classes/five.PBMMaterial.html +17 -0
- package/docs/classes/five.PBMMesh.html +7 -0
- package/docs/classes/five.PanoCircleMesh.html +7 -0
- package/docs/classes/five.Scene.html +3 -0
- package/docs/classes/five.Subscribe.html +56 -0
- package/docs/classes/five.Tile3DModel.html +15 -0
- package/docs/classes/five.Work.html +30 -0
- package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
- package/docs/classes/gltf_loader.GLTFObject.html +7 -0
- package/docs/classes/line.Line.html +1 -0
- package/docs/classes/line.LineGeometry.html +1 -0
- package/docs/classes/line.LineMaterial.html +1 -0
- package/docs/classes/line.LineSegmentsGeometry.html +1 -0
- package/docs/classes/line.THREE_Line2.html +1 -0
- package/docs/classes/line.THREE_LineSegments2.html +1 -0
- package/docs/classes/react.Store.html +29 -0
- package/docs/classes/server.BVH.html +10 -0
- package/docs/classes/server.BVHIntersect.html +1 -0
- package/docs/classes/server.BVHNode.html +7 -0
- package/docs/classes/server.BVHVector3.html +1 -0
- package/docs/classes/server.Model.html +63 -0
- package/docs/classes/server.PBMGroup.html +9 -0
- package/docs/classes/server.PBMMesh.html +7 -0
- package/docs/classes/sticker.Sticker.html +32 -0
- package/docs/index.html +166 -422
- package/docs/interfaces/five.AddableObject.html +1 -0
- package/docs/interfaces/five.AnimationFrame.html +1 -0
- package/docs/interfaces/five.CameraPose.html +1 -0
- package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
- package/docs/interfaces/five.EventCallback.html +391 -0
- package/docs/interfaces/five.FiveInitArgs.html +100 -0
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
- package/docs/interfaces/five.ImageOptions.html +18 -0
- package/docs/interfaces/five.ImageURLMappings.html +1 -0
- package/docs/interfaces/five.ImageURLOptions.html +17 -0
- package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
- package/docs/interfaces/five.Intersection.html +7 -0
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
- package/docs/interfaces/five.ModelEventCallback.html +22 -0
- package/docs/interfaces/five.MovePanoOptions.html +42 -0
- package/docs/interfaces/five.PBMPanoPicture.html +7 -0
- package/docs/interfaces/five.PBMParameters.html +17 -0
- package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +28 -0
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
- package/docs/interfaces/five.Pose.html +37 -0
- package/docs/interfaces/five.Scissor.html +14 -0
- package/docs/interfaces/five.State.html +21 -0
- package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
- package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
- package/docs/interfaces/five.TextureOptions.html +20 -0
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +24 -0
- package/docs/interfaces/five.WorkCubeImage.html +13 -0
- package/docs/interfaces/five.WorkImage.html +21 -0
- package/docs/interfaces/five.WorkInitial.html +13 -0
- package/docs/interfaces/five.WorkModel.html +11 -0
- package/docs/interfaces/five.WorkModelTiles.html +3 -0
- package/docs/interfaces/five.WorkObserver.html +25 -0
- package/docs/interfaces/five.WorkTile.html +1 -0
- package/docs/interfaces/five.WorkVideo.html +9 -0
- package/docs/interfaces/gltf_loader.GLTF.html +7 -0
- package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
- package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
- package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
- package/docs/interfaces/server.Intersection.html +7 -0
- package/docs/interfaces/server.ModelEventCallback.html +18 -0
- package/docs/interfaces/sticker.IntersectionLike.html +8 -0
- package/docs/interfaces/vue.FiveActionVueCallbacks.html +62 -0
- package/docs/modules/five.SubscribeMixinType.html +1 -0
- package/docs/modules/five.html +482 -0
- package/docs/modules/gltf_loader.html +1 -0
- package/docs/modules/line.html +1 -0
- package/docs/modules/react.html +130 -1178
- package/docs/modules/server.html +18 -0
- package/docs/modules/sticker.html +1 -0
- package/docs/modules/vue.html +112 -0
- package/docs/modules.html +1 -120
- package/exporters/staticify.js +210 -0
- package/{index.d.ts → five/index.d.ts} +1178 -322
- package/five/index.js +372 -0
- package/gltf-loader/index.d.ts +75 -0
- package/gltf-loader/index.js +260 -0
- package/line/index.d.ts +68 -0
- package/line/index.js +260 -0
- package/package.json +25 -17
- package/react/index.d.ts +160 -92
- package/react/index.js +260 -1
- package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
- package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
- package/resource/gltf/draco_decoder.js +31 -0
- package/resource/gltf/draco_decoder.wasm +0 -0
- package/resource/gltf/draco_wasm_wrapper.js +119 -0
- package/scripts/five-staticify.js +26 -0
- package/server/index.d.ts +194 -25
- package/server/index.js +367 -1
- package/sticker/index.d.ts +70 -0
- package/sticker/index.js +260 -0
- package/templates/quick-start/README.md +1 -1
- package/templates/quick-start/package.json +1 -1
- package/templates/react-component/lib/index.tsx +3 -3
- package/umd/five-gltf-loader.js +2 -0
- package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
- package/umd/five-line.js +2 -0
- package/umd/five-line.js.LICENSE.txt +14 -0
- package/umd/five-react.js +2 -0
- package/umd/five-react.js.LICENSE.txt +14 -0
- package/umd/five-sticker.js +2 -0
- package/umd/five-sticker.js.LICENSE.txt +14 -0
- package/umd/five-vue.js +1 -0
- package/umd/five.js +2 -0
- package/umd/five.js.LICENSE.txt +116 -0
- package/vue/index.d.ts +433 -0
- package/vue/index.js +260 -0
- package/bundles/five.js +0 -2
- package/bundles/five.js.LICENSE.txt +0 -160
- package/docs/assets/css/main.css +0 -2660
- package/docs/assets/js/main.js +0 -248
- package/docs/assets/js/search.js +0 -1
- package/docs/classes/index.five.html +0 -2498
- package/docs/classes/index.fivecamera.html +0 -311
- package/docs/classes/index.fivehashcubetexture.html +0 -240
- package/docs/classes/index.fiveline.html +0 -342
- package/docs/classes/index.fivelinegeometry.html +0 -500
- package/docs/classes/index.fivelinematerial.html +0 -276
- package/docs/classes/index.fivelinesegmentsgeometry.html +0 -447
- package/docs/classes/index.fivescene.html +0 -186
- package/docs/classes/index.internalwebglrenderer.html +0 -200
- package/docs/classes/index.model.html +0 -883
- package/docs/classes/index.pbmgroup.html +0 -415
- package/docs/classes/index.pbmmaterial.html +0 -521
- package/docs/classes/index.pbmmesh.html +0 -242
- package/docs/classes/index.subscribe.html +0 -556
- package/docs/classes/react.store.html +0 -584
- package/docs/interfaces/index.depthpanoramacontrollercustominitargs.html +0 -408
- package/docs/interfaces/index.eventcallback.html +0 -2452
- package/docs/interfaces/index.fiveinitargs.html +0 -695
- package/docs/interfaces/index.floorplancontrollercustominitargs.html +0 -283
- package/docs/interfaces/index.imageoptions.html +0 -320
- package/docs/interfaces/index.intersection.html +0 -215
- package/docs/interfaces/index.intersectmeshinterface.html +0 -176
- package/docs/interfaces/index.modelcontrollercustominitargs.html +0 -354
- package/docs/interfaces/index.modeleventcallback.html +0 -316
- package/docs/interfaces/index.movepanooptions.html +0 -457
- package/docs/interfaces/index.panocirclemeshinterface.html +0 -349
- package/docs/interfaces/index.panoramacontrollercustominitargs.html +0 -433
- package/docs/interfaces/index.panoramalikecontrollercustominitargs.html +0 -352
- package/docs/interfaces/index.pbmparameters.html +0 -462
- package/docs/interfaces/index.pose.html +0 -258
- package/docs/interfaces/index.scissor.html +0 -240
- package/docs/interfaces/index.state.html +0 -288
- package/docs/interfaces/index.subscribemixintype.emit.html +0 -180
- package/docs/interfaces/index.subscribemixintype.haslistener.html +0 -171
- package/docs/interfaces/index.subscribemixintype.off.html +0 -198
- package/docs/interfaces/index.subscribemixintype.on.html +0 -213
- package/docs/interfaces/index.subscribemixintype.once.html +0 -210
- package/docs/interfaces/index.topviewcontrollercustominitargs.html +0 -214
- package/docs/interfaces/index.vrpanoramacontrollercustominitargs.html +0 -420
- package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -559
- package/docs/interfaces/react.fiveinjectiontypes.html +0 -1473
- package/docs/interfaces/react.injectfivetoprops.html +0 -259
- package/docs/modules/index.html +0 -3027
- package/docs/modules/index.subscribemixintype.html +0 -143
- package/five.js.LICENSE.txt +0 -160
- package/index.js +0 -1
- package/scripts/export-five-resource/chfs.exe +0 -0
- package/scripts/export-five-resource/fileify.js +0 -192
- package/scripts/export-five-resource/format-work.js +0 -71
- package/scripts/export-five-resource/staticify.js +0 -327
- package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
- package/scripts/transcode-model/LoaderSupport.js +0 -1545
- package/scripts/transcode-model/MTLLoader.js +0 -602
- package/scripts/transcode-model/OBJLoader2.js +0 -1470
- package/scripts/transcode-model/obj2pbm.js +0 -65
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const archiver = require("archiver");
|
|
4
|
+
const ejs = require("ejs");
|
|
5
|
+
const { parseWork } = require("@realsee/five/server");
|
|
6
|
+
|
|
7
|
+
function matchJsonpFunctionName(url) {
|
|
8
|
+
const regExps = [
|
|
9
|
+
/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,
|
|
10
|
+
/jsonp_([0-9a-z]+)([\?\#].*)?$/i
|
|
11
|
+
];
|
|
12
|
+
for (const regExp of regExps) {
|
|
13
|
+
const matched = url.match(regExp);
|
|
14
|
+
if (matched) {
|
|
15
|
+
return "jsonp_" + matched[1];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const CDN_PUBLIC_BASE = "//vrlab-public.ljcdn.com";
|
|
22
|
+
const CDN_IMAGE_BASE = "//vrlab-image4.ljcdn.com";
|
|
23
|
+
const CDN_TEST_PUBLIC_BASE = "//test-vr-public.realsee-cdn.com";
|
|
24
|
+
const CDN_TEST_IMAGE_BASE = "//test-vr-image.realsee-cdn.com";
|
|
25
|
+
function imageURL(url, size) {
|
|
26
|
+
if (url.indexOf(CDN_PUBLIC_BASE) >= 0) {
|
|
27
|
+
if (/\.(jpg|png)$/.test(url)) {
|
|
28
|
+
// 默认使用数据万象
|
|
29
|
+
// https://cloud.tencent.com/document/product/460/36544
|
|
30
|
+
if (size) {
|
|
31
|
+
let suffix = "?imageMogr2";
|
|
32
|
+
if (size) suffix += "/thumbnail/" + size + "x";
|
|
33
|
+
url = url.replace(CDN_PUBLIC_BASE, CDN_IMAGE_BASE) + suffix;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (url.indexOf(CDN_TEST_PUBLIC_BASE) >= 0) {
|
|
38
|
+
if (/\.(jpg|png)$/.test(url)) {
|
|
39
|
+
// 默认使用数据万象
|
|
40
|
+
// https://cloud.tencent.com/document/product/460/36544
|
|
41
|
+
if (size) {
|
|
42
|
+
let suffix = "?imageMogr2";
|
|
43
|
+
if (size) suffix += "/thumbnail/" + size + "x";
|
|
44
|
+
url = url.replace(CDN_TEST_PUBLIC_BASE, CDN_TEST_IMAGE_BASE) + suffix;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return url;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function download(url, jsonpHandleKey) {
|
|
52
|
+
const request = /^https\:/.test(url) ? require("https") : require("http");
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
const req = request.get(url, res => {
|
|
55
|
+
const mime = res.headers['content-type'];
|
|
56
|
+
const buffers = [];
|
|
57
|
+
|
|
58
|
+
res.on('data', chunk => buffers.push(chunk));
|
|
59
|
+
res.on('end', () => {
|
|
60
|
+
const contents = Buffer.concat(buffers);
|
|
61
|
+
if (jsonpHandleKey) {
|
|
62
|
+
const dataURL = `data:${mime};base64,${contents.toString('base64')}`;
|
|
63
|
+
const jsopContents = `window[${JSON.stringify(jsonpHandleKey)}] && window[${JSON.stringify(jsonpHandleKey)}](${JSON.stringify(dataURL)})`;
|
|
64
|
+
resolve(Buffer.from(jsopContents));
|
|
65
|
+
} else {
|
|
66
|
+
resolve(Buffer.from(contents));
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
res.on("error", () => reject(new Error(`fetch ${url} got error`)));
|
|
70
|
+
});
|
|
71
|
+
req.on("error", () => reject(new Error(`fetch ${url} got error`)));
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const template = `
|
|
76
|
+
<!DOCTYPE html>
|
|
77
|
+
<html lang="en">
|
|
78
|
+
<head>
|
|
79
|
+
<meta charset="UTF-8">
|
|
80
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
81
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
82
|
+
<title>REALSEE PREVIEW</title>
|
|
83
|
+
<style>
|
|
84
|
+
* { margin: 0; padding: 0; }
|
|
85
|
+
html, body { height: 100%; width: 100%; overflow: hidden; }
|
|
86
|
+
#app { position: fixed; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
|
|
87
|
+
.buttons { position: fixed; top: 10px; left: 10px; pointer-events: none; }
|
|
88
|
+
.buttons h3 { margin-top: 10px; text-shadow: 0 0 2px rgba(255, 255, 255, 0.5); }
|
|
89
|
+
.buttons button { pointer-events: auto; display: block; font-size: 14px; color: #FFF; background: #5a6268; padding: 3px 10px; border: 1px solid #333; margin-right: 2px; border-radius: 2px; cursor: pointer; margin-top: 10px; }
|
|
90
|
+
.buttons button:active { background: #333; }
|
|
91
|
+
</style>
|
|
92
|
+
<script src="./three.min.js"></script>
|
|
93
|
+
<script src="./five.js"></script>
|
|
94
|
+
<script>const workJSON = <%- JSON.stringify(work_json) %></script>
|
|
95
|
+
</head>
|
|
96
|
+
<body>
|
|
97
|
+
<!-- 试图渲染容器 -->
|
|
98
|
+
<div id="app"></div>
|
|
99
|
+
<script>
|
|
100
|
+
const five = new FiveSDK.Five();
|
|
101
|
+
five.appendTo(document.getElementById("app"));
|
|
102
|
+
const work = FiveSDK.parseWork(workJSON, { baseURL: "./", shortPath: <%- JSON.stringify(short_path) %>, jsonp: <%- JSON.stringify(jsonp) %> });
|
|
103
|
+
five.load(work);
|
|
104
|
+
|
|
105
|
+
const modeButtons = [
|
|
106
|
+
{ mode: "Panorama", label: "全景模式" },
|
|
107
|
+
{ mode: "Floorplan", label: "模型纵览模式" },
|
|
108
|
+
{ mode: "Topview", label: "模型俯视模式" },
|
|
109
|
+
{ mode: "Model", label: "模型漫游模式" },
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
const buttons = document.createElement("div");
|
|
113
|
+
buttons.className = "buttons";
|
|
114
|
+
document.body.appendChild(buttons);
|
|
115
|
+
buttons.appendChild(document.createElement("h3")).innerHTML = "模式控制";
|
|
116
|
+
|
|
117
|
+
// 模态按钮
|
|
118
|
+
for (let i = 0; i < modeButtons.length; i++) {
|
|
119
|
+
const button = document.createElement("button");
|
|
120
|
+
button.innerHTML = modeButtons[i].label;
|
|
121
|
+
button.addEventListener('click', () => {
|
|
122
|
+
// 通过 changeMode 方法可以切换模态
|
|
123
|
+
five.changeMode(FiveSDK.Five.Mode[modeButtons[i].mode]);
|
|
124
|
+
});
|
|
125
|
+
buttons.appendChild(button);
|
|
126
|
+
}
|
|
127
|
+
window.addEventListener("resize", () => five.refresh(), false);
|
|
128
|
+
</script>
|
|
129
|
+
</body>
|
|
130
|
+
</html>
|
|
131
|
+
`;
|
|
132
|
+
|
|
133
|
+
function getThreeJsBuffer() {
|
|
134
|
+
let tempPath = path.resolve(__dirname);
|
|
135
|
+
while (!(tempPath === '/' || tempPath === ".")) {
|
|
136
|
+
const threeFilePath = path.join(tempPath, "node_modules/three/build/three.min.js");
|
|
137
|
+
if (fs.existsSync(threeFilePath)) {
|
|
138
|
+
return fs.readFileSync(threeFilePath);
|
|
139
|
+
}
|
|
140
|
+
tempPath = path.dirname(tempPath);
|
|
141
|
+
}
|
|
142
|
+
throw new Error("three.js is not found");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function getFiveJsBuffer() {
|
|
146
|
+
return fs.readFileSync(path.join(__dirname, "../umd/five.js"));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
async function staticify(work, output, shortPath = false, jsonp = false, preview = true) {
|
|
150
|
+
const zipFilename = /\.zip$/.test(output) ? output : output + ".zip";
|
|
151
|
+
const outputStream = fs.createWriteStream(zipFilename);
|
|
152
|
+
const archive = archiver("zip", { zlib: { level: 9 } });
|
|
153
|
+
archive.on("error", (err) => { throw err; });
|
|
154
|
+
outputStream.on("close", function() {
|
|
155
|
+
console.log(`zip ${archive.pointer()} total bytes`);
|
|
156
|
+
console.log(`dist ${zipFilename}`);
|
|
157
|
+
});
|
|
158
|
+
archive.pipe(outputStream);
|
|
159
|
+
|
|
160
|
+
const resources = [];
|
|
161
|
+
const workJSONObject = JSON.parse(fs.readFileSync(work, "utf8"));
|
|
162
|
+
parseWork(workJSONObject, { shortPath, jsonp }, (origin, _, relative, type) => {
|
|
163
|
+
resources.push({ origin, relative, type });
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
const textureCount = resources.filter(({ type }) => type === "texture").length;
|
|
167
|
+
let textureSize;
|
|
168
|
+
if (textureCount > 50) {
|
|
169
|
+
textureSize = 64;
|
|
170
|
+
} else if (textureCount > 40) {
|
|
171
|
+
textureSize = 128;
|
|
172
|
+
} else if (textureCount > 30) {
|
|
173
|
+
textureSize = 256;
|
|
174
|
+
} else if (textureCount > 15) {
|
|
175
|
+
textureSize = 512;
|
|
176
|
+
} else if (textureCount > 10) {
|
|
177
|
+
textureSize = 1024;
|
|
178
|
+
}
|
|
179
|
+
if (textureSize) {
|
|
180
|
+
for (const resource of resources) {
|
|
181
|
+
if (resource.type === "texture") {
|
|
182
|
+
resource.origin = imageURL(resource.origin, textureSize);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
for (const { origin, relative } of resources) {
|
|
187
|
+
const buffer = await download(origin, matchJsonpFunctionName(relative));
|
|
188
|
+
console.log(`${origin} -> ${relative}`);
|
|
189
|
+
archive.append(buffer, { name: relative });
|
|
190
|
+
}
|
|
191
|
+
archive.append(fs.readFileSync(work), { name: "work.json" });
|
|
192
|
+
|
|
193
|
+
if (preview) {
|
|
194
|
+
archive.append(getFiveJsBuffer(), { name: "five.js" });
|
|
195
|
+
archive.append(getThreeJsBuffer(), { name: "three.min.js" });
|
|
196
|
+
|
|
197
|
+
const data = {
|
|
198
|
+
work_json: workJSONObject,
|
|
199
|
+
short_path: Boolean(shortPath),
|
|
200
|
+
jsonp: Boolean(jsonp),
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const html = typeof preview === 'string' ? ejs.render(fs.readFileSync(preview, "utf8"), data) : ejs.render(template, data);
|
|
204
|
+
archive.append(html, { name: "index.html" });
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
archive.finalize();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
module.exports = staticify;
|