clean webpack config
parent
7a86c8029a
commit
e661020dc8
|
@ -1 +1,2 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
|
dist/bundle.js*
|
|
@ -3,7 +3,7 @@
|
||||||
"start": "webpack serve --config webpack.dev.js",
|
"start": "webpack serve --config webpack.dev.js",
|
||||||
"build": "webpack --config webpack.prod.js",
|
"build": "webpack --config webpack.prod.js",
|
||||||
"get-bundle-size": "webpack --profile --json > stats.json --config webpack.prod.js && webpack-bundle-analyzer stats.json dist/",
|
"get-bundle-size": "webpack --profile --json > stats.json --config webpack.prod.js && webpack-bundle-analyzer stats.json dist/",
|
||||||
"deploy": "gh-pages -d dist -t true"
|
"deploy": "webpack --config webpack.prod.js && gh-pages -d dist -t true"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-react": "^7.12.13",
|
"@babel/preset-react": "^7.12.13",
|
||||||
|
|
10
src/index.js
10
src/index.js
|
@ -5,13 +5,13 @@ import { OrbitControls } from './OrbitControls'
|
||||||
import { TrackballControls } from './trackball'
|
import { TrackballControls } from './trackball'
|
||||||
import { Sketcher } from './sketcher/Sketcher'
|
import { Sketcher } from './sketcher/Sketcher'
|
||||||
import Stats from './stats.module.js';
|
import Stats from './stats.module.js';
|
||||||
|
import ReactDOM from 'react-dom'
|
||||||
import React from 'react';
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom';
|
|
||||||
import { createStore, applyMiddleware } from 'redux'
|
import { createStore, applyMiddleware } from 'redux'
|
||||||
|
|
||||||
import { Root } from './app.jsx'
|
import { Root } from './app.jsx'
|
||||||
|
|
||||||
|
|
||||||
function main(store) {
|
function main(store) {
|
||||||
var stats = new Stats();
|
var stats = new Stats();
|
||||||
stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom
|
stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom
|
||||||
|
@ -114,13 +114,11 @@ console.log(store.getState())
|
||||||
// main(store);
|
// main(store);
|
||||||
main(store);
|
main(store);
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
const root = document.getElementById('react');
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
React.createElement(Root, { store: store }, null)
|
React.createElement(Root, { store: store }, null)
|
||||||
, root
|
, document.getElementById('react')
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
import { Matrix4 } from 'three';
|
|
||||||
|
|
||||||
import * as THREE from 'three/src/Three'
|
import * as THREE from '../../node_modules/three/src/Three';
|
||||||
|
|
||||||
import { drawOnClick1, drawOnClick2, drawPreClick2, drawClear } from './drawEvents'
|
import { drawOnClick1, drawOnClick2, drawPreClick2, drawClear } from './drawEvents'
|
||||||
import { onHover, onDrag, onPick, onRelease } from './pickEvents'
|
import { onHover, onDrag, onPick, onRelease } from './pickEvents'
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import * as THREE from 'three/src/Three'
|
|
||||||
|
|
||||||
import { lineMaterial, pointMaterial } from './Sketcher'
|
|
||||||
|
|
||||||
export function addDimension(ent1, ent2, distance) {
|
export function addDimension(ent1, ent2, distance) {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import * as THREE from 'three/src/Three'
|
import * as THREE from '../../node_modules/three/src/Three';
|
||||||
|
|
||||||
|
|
||||||
export function extrude() {
|
export function extrude() {
|
||||||
|
|
||||||
|
@ -64,7 +63,7 @@ export function extrude() {
|
||||||
const phong = new THREE.MeshPhongMaterial( { color: 0x156289, emissive: 0x072534, side: THREE.DoubleSide, flatShading: true } );
|
const phong = new THREE.MeshPhongMaterial( { color: 0x156289, emissive: 0x072534, side: THREE.DoubleSide, flatShading: true } );
|
||||||
const mesh = new THREE.Mesh(geometry, phong);
|
const mesh = new THREE.Mesh(geometry, phong);
|
||||||
this.add(mesh)
|
this.add(mesh)
|
||||||
|
this.dispatchEvent({ type: 'change' })
|
||||||
// this.sketch.visible = false
|
// this.sketch.visible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import * as THREE from 'three/src/Three'
|
import * as THREE from '../../node_modules/three/src/Three';
|
||||||
|
|
||||||
export function onHover(e) {
|
export function onHover(e) {
|
||||||
if (this.mode || e.buttons) return
|
if (this.mode || e.buttons) return
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as THREE from 'three/src/Three'
|
|
||||||
|
|
||||||
|
import * as THREE from '../../node_modules/three/src/Three';
|
||||||
import {lineMaterial, pointMaterial} from './Sketcher'
|
import {lineMaterial, pointMaterial} from './Sketcher'
|
||||||
|
|
||||||
export function sketchArc(mouseLoc) {
|
export function sketchArc(mouseLoc) {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import * as THREE from 'three/src/Three'
|
import * as THREE from '../../node_modules/three/src/Three';
|
||||||
|
|
||||||
import {lineMaterial, pointMaterial} from './Sketcher'
|
import {lineMaterial, pointMaterial} from './Sketcher'
|
||||||
|
|
||||||
export function sketchLine(mouseLoc) {
|
export function sketchLine(mouseLoc) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3,8 +3,6 @@ const path = require('path');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/index.js',
|
entry: './src/index.js',
|
||||||
|
|
||||||
plugins: [
|
|
||||||
],
|
|
||||||
|
|
||||||
output: {
|
output: {
|
||||||
filename: 'bundle.js',
|
filename: 'bundle.js',
|
||||||
|
@ -30,7 +28,7 @@ module.exports = {
|
||||||
use: {
|
use: {
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
presets: ["@babel/preset-react"]
|
presets: ["@babel/preset-react"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -38,7 +36,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js', '.jsx', '*']
|
extensions: ['.js', '.jsx', '*']
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue