Minify css using esbuild #394
This commit is contained in:
parent
8e7739acb1
commit
eb440871bb
@ -111,10 +111,10 @@ npm start</code></pre>
|
||||
<ul>
|
||||
<li><code class="inline">npm run build_dev</code>: Builds the development version of the engine and the website.</li>
|
||||
<li><code class="inline">npm run build_engine_dev</code>: Builds the development version of the engine.</li>
|
||||
<li><code class="inline">npm run build_engine_prod</code>: Builds the production version of the engine.</li>
|
||||
<li><code class="inline">npm run build_engine</code>: Builds the production version of the engine.</li>
|
||||
<li><code class="inline">npm run build_engine_module</code>: Builds the ES6 module version of the engine. This is the main entry point when using the npm package.</li>
|
||||
<li><code class="inline">npm run build_website_dev</code>: Builds the development version of the website.</li>
|
||||
<li><code class="inline">npm run build_website_prod</code>: Builds the production version of the website.</li>
|
||||
<li><code class="inline">npm run build_website</code>: Builds the production version of the website.</li>
|
||||
</ul>
|
||||
|
||||
<p><b>Testing</b></p>
|
||||
|
||||
@ -49,10 +49,10 @@ npm start</code></pre>
|
||||
<ul>
|
||||
<li><code class="inline">npm run build_dev</code>: Builds the development version of the engine and the website.</li>
|
||||
<li><code class="inline">npm run build_engine_dev</code>: Builds the development version of the engine.</li>
|
||||
<li><code class="inline">npm run build_engine_prod</code>: Builds the production version of the engine.</li>
|
||||
<li><code class="inline">npm run build_engine</code>: Builds the production version of the engine.</li>
|
||||
<li><code class="inline">npm run build_engine_module</code>: Builds the ES6 module version of the engine. This is the main entry point when using the npm package.</li>
|
||||
<li><code class="inline">npm run build_website_dev</code>: Builds the development version of the website.</li>
|
||||
<li><code class="inline">npm run build_website_prod</code>: Builds the production version of the website.</li>
|
||||
<li><code class="inline">npm run build_website</code>: Builds the production version of the website.</li>
|
||||
</ul>
|
||||
|
||||
<p><b>Testing</b></p>
|
||||
|
||||
4
libs/pickr.es5.min.js
vendored
4
libs/pickr.es5.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 - 2021 Simon Reinisch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
3
libs/pickr.monolith.min.css
vendored
3
libs/pickr.monolith.min.css
vendored
File diff suppressed because one or more lines are too long
70
package-lock.json
generated
70
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "online-3d-viewer",
|
||||
"version": "0.8.23",
|
||||
"version": "0.8.24",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "online-3d-viewer",
|
||||
"version": "0.8.23",
|
||||
"version": "0.8.24",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@simonwep/pickr": "1.8.2",
|
||||
@ -19,7 +19,6 @@
|
||||
"web-ifc": "0.0.39"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-css-cli": "^5.6.1",
|
||||
"esbuild": "^0.17.0",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
@ -29,7 +28,7 @@
|
||||
"mocha": "^10.2.0",
|
||||
"oslllo-svg-fixer": "^2.2.0",
|
||||
"rollup": "^3.9.1",
|
||||
"run-python3": "^0.0.4",
|
||||
"run-python3": "^0.0.5",
|
||||
"svgo": "^3.0.2",
|
||||
"typescript": "^5.0.4"
|
||||
}
|
||||
@ -1856,36 +1855,6 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/clean-css": {
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz",
|
||||
"integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"source-map": "~0.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/clean-css-cli": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/clean-css-cli/-/clean-css-cli-5.6.2.tgz",
|
||||
"integrity": "sha512-GDQkr6zVqHJhO3yWTy3sA22sMCT6iUqaJuBdqZMW6oI25MtiJ2iZXDmWzErpjoRotsB+TYPTpuZSNSgaC1n4lA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chokidar": "^3.5.2",
|
||||
"clean-css": "^5.3.2",
|
||||
"commander": "7.x",
|
||||
"glob": "^7.1.6"
|
||||
},
|
||||
"bin": {
|
||||
"cleancss": "bin/cleancss"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/clean-stack": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
|
||||
@ -4759,9 +4728,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/run-python3": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/run-python3/-/run-python3-0.0.4.tgz",
|
||||
"integrity": "sha512-BOWLa/dQ7TeK8mPmRxmJoFa6e/sBl46E7MXn0ZcTwUvXrrmpQbtcybdQRsSFGpMkc40qy++od8yjnOG7TDUufQ==",
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/run-python3/-/run-python3-0.0.5.tgz",
|
||||
"integrity": "sha512-T4PMttPrFhi69d6SlPdbTQbAHTXFcInakyiMzDDswZ6Qe1pjq+vymgrfnf92XtZbuE3LsKf2GGVuviA3tqourw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"child_process": "^1.0.2"
|
||||
@ -6931,27 +6900,6 @@
|
||||
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
|
||||
"dev": true
|
||||
},
|
||||
"clean-css": {
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz",
|
||||
"integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"source-map": "~0.6.0"
|
||||
}
|
||||
},
|
||||
"clean-css-cli": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/clean-css-cli/-/clean-css-cli-5.6.2.tgz",
|
||||
"integrity": "sha512-GDQkr6zVqHJhO3yWTy3sA22sMCT6iUqaJuBdqZMW6oI25MtiJ2iZXDmWzErpjoRotsB+TYPTpuZSNSgaC1n4lA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chokidar": "^3.5.2",
|
||||
"clean-css": "^5.3.2",
|
||||
"commander": "7.x",
|
||||
"glob": "^7.1.6"
|
||||
}
|
||||
},
|
||||
"clean-stack": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
|
||||
@ -9176,9 +9124,9 @@
|
||||
}
|
||||
},
|
||||
"run-python3": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/run-python3/-/run-python3-0.0.4.tgz",
|
||||
"integrity": "sha512-BOWLa/dQ7TeK8mPmRxmJoFa6e/sBl46E7MXn0ZcTwUvXrrmpQbtcybdQRsSFGpMkc40qy++od8yjnOG7TDUufQ==",
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/run-python3/-/run-python3-0.0.5.tgz",
|
||||
"integrity": "sha512-T4PMttPrFhi69d6SlPdbTQbAHTXFcInakyiMzDDswZ6Qe1pjq+vymgrfnf92XtZbuE3LsKf2GGVuviA3tqourw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"child_process": "^1.0.2"
|
||||
|
||||
24
package.json
24
package.json
@ -4,7 +4,7 @@
|
||||
"description": "Online 3D Viewer",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"main": "./build/o3dv.module.js",
|
||||
"main": "./build/engine/o3dv.module.js",
|
||||
"repository": "github:kovacsv/Online3DViewer",
|
||||
"keywords": [
|
||||
"3d",
|
||||
@ -30,9 +30,9 @@
|
||||
"bim"
|
||||
],
|
||||
"files": [
|
||||
"build/o3dv.min.js",
|
||||
"build/o3dv.module.js",
|
||||
"build/o3dv.module.d.ts",
|
||||
"build/engine/o3dv.min.js",
|
||||
"build/engine/o3dv.module.js",
|
||||
"build/engine/o3dv.module.d.ts",
|
||||
"source/engine/*",
|
||||
"libs/loaders/*",
|
||||
"website/assets/envmaps/*"
|
||||
@ -46,20 +46,18 @@
|
||||
"generate_icon_font": "run-python3 tools/generate_icon_font.py",
|
||||
"create_dist": "npm run create_package && npm run lint && npm run test",
|
||||
"create_dist_test": "npm run create_package_test && npm run lint && npm run test",
|
||||
"create_package": "npm run generate_docs && npm run build_engine_prod && npm run build_engine_module && npm run build_website_prod && npm run build_css_prod && run-python3 tools/create_package.py",
|
||||
"create_package_test": "npm run generate_docs && npm run build_engine_prod && npm run build_engine_module && npm run build_website_prod && npm run build_css_prod && run-python3 tools/create_package.py test",
|
||||
"create_package": "npm run generate_docs && npm run build_engine && npm run build_engine_module && npm run build_website && run-python3 tools/create_package.py",
|
||||
"create_package_test": "npm run generate_docs && npm run build_engine && npm run build_engine_module && npm run build_website && run-python3 tools/create_package.py test",
|
||||
"generate_docs": "run-python3 tools/generate_docs.py",
|
||||
"build_css_prod": "cleancss -o build/o3dv.website.min.css website/css/*",
|
||||
"build_dev": "npm run build_engine_dev && npm run build_website_dev",
|
||||
"build_engine_dev": "npm run update_engine_exports && esbuild source/engine/main.js --bundle --minify --global-name=OV --sourcemap --outfile=build/o3dv.min-dev.js",
|
||||
"build_engine_prod": "npm run update_engine_exports && esbuild source/engine/main.js --bundle --minify --global-name=OV --outfile=build/o3dv.min.js",
|
||||
"build_engine_dev": "npm run update_engine_exports && esbuild source/engine/main.js --bundle --minify --global-name=OV --sourcemap --outfile=build/engine_dev/o3dv.min.js",
|
||||
"build_engine": "npm run update_engine_exports && esbuild source/engine/main.js --bundle --minify --global-name=OV --outfile=build/engine/o3dv.min.js",
|
||||
"build_engine_module": "npm run update_engine_exports && rollup --config tools/rollup.js && tsc --project tools/tsconfig.json",
|
||||
"build_website_dev": "esbuild source/website/index.js --bundle --minify --global-name=OV --sourcemap --outfile=build/o3dv.website.min-dev.js",
|
||||
"build_website_prod": "esbuild source/website/index.js --bundle --minify --global-name=OV --outfile=build/o3dv.website.min.js",
|
||||
"build_website_dev": "esbuild source/website/index.js --bundle --minify --global-name=OV --sourcemap --loader:.ttf=file --loader:.woff=file --loader:.svg=file --outfile=build/website_dev/o3dv.website.min.js",
|
||||
"build_website": "esbuild source/website/index.js --bundle --minify --global-name=OV --loader:.ttf=file --loader:.woff=file --loader:.svg=file --outfile=build/website/o3dv.website.min.js",
|
||||
"update_engine_exports": "run-python3 tools/update_engine_exports.py"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-css-cli": "^5.6.1",
|
||||
"esbuild": "^0.17.0",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
@ -69,7 +67,7 @@
|
||||
"mocha": "^10.2.0",
|
||||
"oslllo-svg-fixer": "^2.2.0",
|
||||
"rollup": "^3.9.1",
|
||||
"run-python3": "^0.0.4",
|
||||
"run-python3": "^0.0.5",
|
||||
"svgo": "^3.0.2",
|
||||
"typescript": "^5.0.4"
|
||||
},
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<style>
|
||||
div.online_3d_viewer
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<style>
|
||||
div.online_3d_viewer
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<style>
|
||||
div.online_3d_viewer
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<style>
|
||||
div.online_3d_viewer
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<style>
|
||||
div
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<style>
|
||||
div.online_3d_viewer
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<style>
|
||||
div.online_3d_viewer
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<script type="text/javascript" src="../build/o3dv.min-dev.js"></script>
|
||||
<script type="text/javascript" src="../build/engine_dev/o3dv.min.js"></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
let embeddedViewers = null;
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -3,12 +3,24 @@ import { Embed } from './embed.js';
|
||||
import { Website } from './website.js';
|
||||
import { SetEventHandler, HandleEvent } from './eventhandler.js';
|
||||
import { PluginType, RegisterPlugin } from './pluginregistry.js';
|
||||
import { ButtonDialog, ProgressDialog } from './dialog.js';
|
||||
import { ShowMessageDialog } from './dialogs.js';
|
||||
|
||||
import * as Engine from '../engine/main.js';
|
||||
export { Engine };
|
||||
|
||||
import { ButtonDialog, ProgressDialog } from './dialog.js';
|
||||
import { ShowMessageDialog } from './dialogs.js';
|
||||
import './css/icons.css';
|
||||
import './css/themes.css';
|
||||
import './css/core.css';
|
||||
import './css/controls.css';
|
||||
import './css/dialogs.css';
|
||||
import './css/treeview.css';
|
||||
import './css/panelset.css';
|
||||
import './css/navigator.css';
|
||||
import './css/sidebar.css';
|
||||
import './css/website.css';
|
||||
import './css/embed.css';
|
||||
|
||||
export const UI = {
|
||||
ButtonDialog,
|
||||
ProgressDialog,
|
||||
|
||||
@ -8,6 +8,9 @@ import { SidebarPanel } from './sidebarpanel.js';
|
||||
import { ShadingType } from '../engine/threejs/threeutils.js';
|
||||
import { CameraMode } from '../engine/viewer/camera.js';
|
||||
|
||||
import * as Pickr from '@simonwep/pickr';
|
||||
import '@simonwep/pickr/dist/themes/monolith.min.css';
|
||||
|
||||
function AddColorPicker (parentDiv, opacity, defaultColor, predefinedColors, onChange)
|
||||
{
|
||||
let pickr = Pickr.create ({
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
{
|
||||
"website_lib_files" : [
|
||||
"libs/pickr.monolith.min.css",
|
||||
"libs/pickr.es5.min.js"
|
||||
]
|
||||
}
|
||||
@ -12,22 +12,16 @@ def GetVersion (rootDir):
|
||||
packageJson = json.load (packageJsonFile)
|
||||
return packageJson['version']
|
||||
|
||||
def CreateWebsite (config, rootDir, websiteDir, version, testBuild):
|
||||
def CreateWebsite (rootDir, websiteDir, version, testBuild):
|
||||
if not os.path.exists (websiteDir):
|
||||
os.makedirs (websiteDir)
|
||||
|
||||
if not os.path.exists (os.path.join (websiteDir, 'o3dv')):
|
||||
os.makedirs (os.path.join (websiteDir, 'o3dv'))
|
||||
|
||||
shutil.copy2 (os.path.join (rootDir, 'website', 'index.html'), websiteDir)
|
||||
shutil.copy2 (os.path.join (rootDir, 'website', 'embed.html'), websiteDir)
|
||||
shutil.copy2 (os.path.join (rootDir, 'website', 'robots.txt'), websiteDir)
|
||||
shutil.copy2 (os.path.join (rootDir, 'build', 'o3dv.website.min.js'), os.path.join (websiteDir, 'o3dv'))
|
||||
shutil.copy2 (os.path.join (rootDir, 'build', 'o3dv.website.min.css'), os.path.join (websiteDir, 'o3dv'))
|
||||
shutil.copytree (os.path.join (rootDir, 'libs'), os.path.join (websiteDir, 'libs'))
|
||||
shutil.copytree (os.path.join (rootDir, 'build', 'website'), os.path.join (websiteDir, 'o3dv'))
|
||||
shutil.copytree (os.path.join (rootDir, 'website', 'assets'), os.path.join (websiteDir, 'assets'))
|
||||
shutil.copytree (os.path.join (rootDir, 'website', 'css', 'Quicksand'), os.path.join (websiteDir, 'o3dv', 'Quicksand'))
|
||||
shutil.copytree (os.path.join (rootDir, 'website', 'css', 'O3DVIcons'), os.path.join (websiteDir, 'o3dv', 'O3DVIcons'))
|
||||
shutil.copytree (os.path.join (rootDir, 'website', 'info'), os.path.join (websiteDir, 'info'))
|
||||
|
||||
pluginFiles = []
|
||||
@ -42,7 +36,6 @@ def CreateWebsite (config, rootDir, websiteDir, version, testBuild):
|
||||
shutil.copy2 (os.path.join (pluginsDir, pluginFile), os.path.join (websitePluginsDir, pluginFile))
|
||||
pluginFiles.append ('plugins/' + pluginFile)
|
||||
|
||||
websiteLibFiles = config['website_lib_files']
|
||||
websiteFiles = [
|
||||
'o3dv/o3dv.website.min.css',
|
||||
'o3dv/o3dv.website.min.js'
|
||||
@ -58,7 +51,6 @@ def CreateWebsite (config, rootDir, websiteDir, version, testBuild):
|
||||
for htmlFileName in htmlFileNames:
|
||||
htmlFilePath = os.path.join (websiteDir, htmlFileName)
|
||||
replacer = Utils.TokenReplacer (htmlFilePath, False)
|
||||
replacer.ReplaceTokenFileLinks ('<!-- website libs start -->', '<!-- website libs end -->', websiteLibFiles, version)
|
||||
replacer.ReplaceTokenFileLinks ('<!-- website start -->', '<!-- website end -->', websiteFiles, version)
|
||||
replacer.ReplaceTokenFileLinks ('<!-- plugins start -->', '<!-- plugins end -->', pluginFiles, version)
|
||||
initScriptContent = ''
|
||||
@ -85,11 +77,11 @@ def CreateWebsite (config, rootDir, websiteDir, version, testBuild):
|
||||
replacer.ReplaceTokenContent ('<!-- intro start -->', '<!-- intro end -->', introContent)
|
||||
replacer.WriteToFile (htmlFilePath)
|
||||
|
||||
def CreatePackage (rootDir, websiteDir, packageDir):
|
||||
if not os.path.exists (packageDir):
|
||||
os.makedirs (packageDir)
|
||||
def CreateEnginePackage (rootDir, engineDir, websiteDir):
|
||||
if not os.path.exists (engineDir):
|
||||
os.makedirs (engineDir)
|
||||
|
||||
zipPath = os.path.join (packageDir, 'o3dv.zip')
|
||||
zipPath = os.path.join (engineDir, 'o3dv.zip')
|
||||
zip = zipfile.ZipFile (zipPath, mode = 'w', compression = zipfile.ZIP_DEFLATED)
|
||||
for file in os.listdir (os.path.join (websiteDir, 'libs', 'loaders')):
|
||||
zip.write (os.path.join (websiteDir, 'libs', 'loaders', file), 'libs/loaders/' + file)
|
||||
@ -100,7 +92,7 @@ def CreatePackage (rootDir, websiteDir, packageDir):
|
||||
zip.write (os.path.join (filePath, fileInDir), 'envmaps/' + file + '/' + fileInDir)
|
||||
else:
|
||||
zip.write (filePath, 'envmaps/' + file)
|
||||
zip.write (os.path.join (rootDir, 'build', 'o3dv.min.js'), 'o3dv.min.js')
|
||||
zip.write (os.path.join (rootDir, 'build', 'engine', 'o3dv.min.js'), 'o3dv.min.js')
|
||||
zip.write (os.path.join (rootDir, 'LICENSE.md'), 'o3dv.license.md')
|
||||
zip.close ()
|
||||
return True
|
||||
@ -112,27 +104,23 @@ def Main (argv):
|
||||
|
||||
testBuild = False
|
||||
|
||||
buildDir = os.path.join (rootDir, 'build', 'final')
|
||||
buildDir = os.path.join (rootDir, 'build', 'package')
|
||||
if len (argv) >= 2 and argv[1] == 'test':
|
||||
testBuild = True
|
||||
buildDir = os.path.join (rootDir, 'build', 'test')
|
||||
buildDir = os.path.join (rootDir, 'build', 'package_test')
|
||||
Utils.PrintInfo ('Creating test build.')
|
||||
|
||||
websiteDir = os.path.join (buildDir, 'website')
|
||||
packageDir = os.path.join (buildDir, 'package')
|
||||
engineDir = os.path.join (buildDir, 'engine')
|
||||
if os.path.exists (buildDir):
|
||||
shutil.rmtree (buildDir)
|
||||
|
||||
config = None
|
||||
with open (os.path.join (toolsDir, 'config.json')) as configJson:
|
||||
config = json.load (configJson)
|
||||
|
||||
version = GetVersion (rootDir)
|
||||
Utils.PrintInfo ('Create build directory')
|
||||
CreateWebsite (config, rootDir, websiteDir, version, testBuild)
|
||||
CreateWebsite (rootDir, websiteDir, version, testBuild)
|
||||
|
||||
Utils.PrintInfo ('Create package.')
|
||||
packageResult = CreatePackage (rootDir, websiteDir, packageDir)
|
||||
packageResult = CreateEnginePackage (rootDir, engineDir, websiteDir)
|
||||
if not packageResult:
|
||||
Utils.PrintError ('Create package failed.')
|
||||
return 1
|
||||
|
||||
@ -33,7 +33,7 @@ def Main (argv):
|
||||
'-n', 'O3DVIcons'
|
||||
])
|
||||
|
||||
websiteCssDir = os.path.join (rootDir, 'website', 'css')
|
||||
websiteCssDir = os.path.join (rootDir, 'source', 'website', 'css')
|
||||
websiteIconFontDir = os.path.join (websiteCssDir, 'O3DVIcons')
|
||||
if not os.path.exists (websiteIconFontDir):
|
||||
os.makedirs (websiteIconFontDir)
|
||||
|
||||
@ -2,7 +2,7 @@ export default [
|
||||
{
|
||||
input: 'source/engine/main.js',
|
||||
output: {
|
||||
file: 'build/o3dv.module.js',
|
||||
file: 'build/engine/o3dv.module.js',
|
||||
format: 'es'
|
||||
},
|
||||
external: [
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"include": ["../build/o3dv.module.js"],
|
||||
"include": ["../build/engine/o3dv.module.js"],
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"declaration": true,
|
||||
|
||||
@ -12,18 +12,8 @@
|
||||
<!-- meta end -->
|
||||
|
||||
<!-- website start -->
|
||||
<link rel="stylesheet" type="text/css" href="css/icons.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/themes.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/core.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/controls.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/dialogs.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/treeview.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/panelset.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/navigator.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/sidebar.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/website.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/embed.css">
|
||||
<script type="text/javascript" src="../build/o3dv.website.min-dev.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../build/website_dev/o3dv.website.min.css">
|
||||
<script type="text/javascript" src="../build/website_dev/o3dv.website.min.js"></script>
|
||||
<!-- website end -->
|
||||
|
||||
<!-- analytics start -->
|
||||
|
||||
@ -9,27 +9,12 @@
|
||||
|
||||
<title>Online 3D Viewer</title>
|
||||
|
||||
<!-- website libs start -->
|
||||
<link rel="stylesheet" type="text/css" href="../libs/pickr.monolith.min.css">
|
||||
<script type="text/javascript" src="../libs/pickr.es5.min.js"></script>
|
||||
<!-- website libs end -->
|
||||
|
||||
<!-- meta start -->
|
||||
<!-- meta end -->
|
||||
|
||||
<!-- website start -->
|
||||
<link rel="stylesheet" type="text/css" href="css/icons.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/themes.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/core.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/controls.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/dialogs.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/treeview.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/panelset.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/navigator.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/sidebar.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/website.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/embed.css">
|
||||
<script type="text/javascript" src="../build/o3dv.website.min-dev.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../build/website_dev/o3dv.website.min.css">
|
||||
<script type="text/javascript" src="../build/website_dev/o3dv.website.min.js"></script>
|
||||
<!-- website end -->
|
||||
<!-- plugins start -->
|
||||
<!-- plugins end -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user