From 02995d6a62839ff4d62a3f5fe01b383841bca23b Mon Sep 17 00:00:00 2001 From: ChenX Date: Sun, 5 May 2019 15:28:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4dat.gui=20=E4=BD=BF=E7=94=A8c?= =?UTF-8?q?ache-loader=E4=BB=A3=E6=9B=BF=E6=97=A7=E7=9A=84webpack=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/webpack.common.ts | 6 +++--- package.json | 3 --- src/ApplicationServices/Application.ts | 4 ---- src/Editor/DebugDatUi.ts | 21 --------------------- src/UI/Layout/ApplicationLayout.tsx | 1 - src/webview.ts | 19 ------------------- 6 files changed, 3 insertions(+), 51 deletions(-) delete mode 100644 src/Editor/DebugDatUi.ts diff --git a/config/webpack.common.ts b/config/webpack.common.ts index 76d44a0fd..b14989047 100644 --- a/config/webpack.common.ts +++ b/config/webpack.common.ts @@ -1,6 +1,6 @@ import * as AddAssetHtmlPlugin from "add-asset-html-webpack-plugin"; import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); -import * as HardSourceWebpackPlugin from 'hard-source-webpack-plugin'; +// import * as HardSourceWebpackPlugin from 'hard-source-webpack-plugin'; import * as HtmlWebPackPlugin from "html-webpack-plugin"; import * as CleanWebpackPlugin from 'clean-webpack-plugin'; import * as path from 'path'; @@ -40,7 +40,7 @@ const config: webpack.Configuration = { test: /\.tsx?$/, exclude: /node_modules/, use: [ - // { loader: 'cache-loader' }, + { loader: 'cache-loader', options: { cacheDirectory: "node_modules/.cache_loader" } }, { loader: 'ts-loader', options: { @@ -142,7 +142,7 @@ const config: webpack.Configuration = { React: 'react', THREE: "three" }), - new HardSourceWebpackPlugin(), + // new HardSourceWebpackPlugin(), new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true }), new CleanWebpackPlugin([`./dist/*.main.js`], { root: path.resolve(__dirname, "..") }), ], diff --git a/package.json b/package.json index d42a07727..34dd58c86 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "license": "ISC", "devDependencies": { "@types/blueimp-md5": "^2.7.0", - "@types/dat-gui": "^0.6.3", "@types/hard-source-webpack-plugin": "^1.0.0", "@types/html-webpack-plugin": "^3.2.0", "@types/jest": "^24.0.0", @@ -44,7 +43,6 @@ "fork-ts-checker-webpack-plugin": "^0.5.2", "git-revision-webpack-plugin": "^3.0.3", "gitlog": "^3.1.2", - "hard-source-webpack-plugin": "https://github.com/FishOrBear/hard-source-webpack-plugin", "html-loader": "^0.5.5", "html-webpack-plugin": "^3.2.0", "jest": "^24.7.1", @@ -75,7 +73,6 @@ "dependencies": { "@blueprintjs/core": "^3.13.0", "blueimp-md5": "^2.10.0", - "dat.gui": "^0.7.5", "golden-layout": "^1.5.9", "mobx": "^5.9.0", "mobx-react": "^5.4.3", diff --git a/src/ApplicationServices/Application.ts b/src/ApplicationServices/Application.ts index 9cac66053..d3d07467d 100644 --- a/src/ApplicationServices/Application.ts +++ b/src/ApplicationServices/Application.ts @@ -9,7 +9,6 @@ import { FontLoader } from '../DatabaseServices/Text/FontLoader'; import { CameraControls } from '../Editor/CameraControls'; import { commandMachine } from '../Editor/CommandMachine'; import { ContextMenu } from '../Editor/ContextMenu'; -import { DatGUI } from '../Editor/DebugDatUi'; import { Editor } from '../Editor/Editor'; import { Gesture } from '../Editor/Gesture'; import { RegisterGesture } from '../Editor/RegisterGesture'; @@ -26,7 +25,6 @@ export let app: ApplicationService; */ export class ApplicationService { - gui: DatGUI; m_Database: Database; m_Viewer: Viewer; m_Editor: Editor; @@ -53,8 +51,6 @@ export class ApplicationService new CameraControls(this.m_Viewer); - this.gui = new DatGUI(); - this.m_Editor = new Editor(this); new ContextMenu(this.m_Editor); let gt = new Gesture(this.m_Editor); diff --git a/src/Editor/DebugDatUi.ts b/src/Editor/DebugDatUi.ts deleted file mode 100644 index 11f6b7a95..000000000 --- a/src/Editor/DebugDatUi.ts +++ /dev/null @@ -1,21 +0,0 @@ - -// import * as dat from "dat.gui" -export class DatGUI -{ - //UI. - m_Ctrl_UI: any; //dat.GUI - color: string = "#ffae23"; - - constructor() - { - // this.m_Ctrl_UI = new dat.GUI( - // { - // autoPlace: true, - // width: 300, - // } - // ); - - // this.m_Ctrl_UI.domElement.parentElement.style.top = "36px"; - // this.m_Ctrl_UI.addColor(this, "color"); - } -} \ No newline at end of file diff --git a/src/UI/Layout/ApplicationLayout.tsx b/src/UI/Layout/ApplicationLayout.tsx index a142bf253..5e859fd72 100644 --- a/src/UI/Layout/ApplicationLayout.tsx +++ b/src/UI/Layout/ApplicationLayout.tsx @@ -196,5 +196,4 @@ function RenderComponent(Components, el: Element, store?: any) , el); else ReactDOM.render(, el) - } diff --git a/src/webview.ts b/src/webview.ts index 896a9b780..19635a3d4 100644 --- a/src/webview.ts +++ b/src/webview.ts @@ -1,7 +1,5 @@ import * as THREE from 'three'; -import { guiMaterial, guiMeshBasicMaterial, guiScene } from './Common/Material'; import { CameraControlState } from './Editor/CameraControls'; -import { DatGUI } from './Editor/DebugDatUi'; import './UI/Css/style.less'; import '../../Css/switchTheme.less' import { WebCADView } from './WebCADView/WebCADView'; @@ -118,23 +116,6 @@ window.onload = async () => } btn = createBtn("旋转", content, rotateSwithMove); - - - { - let mat = new THREE.MeshBasicMaterial({ color: 0xc8575b }) - let geometry = new THREE.BoxGeometry(10, 10, 10); - - let mat2 = new THREE.MeshNormalMaterial(); - let mesh = new THREE.Mesh(geometry, mat); - window["mat"] = mat2; - let gui = new DatGUI(); - - guiMeshBasicMaterial(gui.m_Ctrl_UI, mesh, mat, mesh.geometry); - guiMaterial(gui.m_Ctrl_UI, mesh, mat, mesh.geometry); - guiScene(gui.m_Ctrl_UI, app.m_Viewer.Scene, app.m_Viewer.m_Render, hemiLight); - - app.m_Viewer.Scene.add(mesh); - } } function parseQuery(search): Object