clean webpack config

master
howard 2021-03-26 13:40:40 -07:00
parent 7a86c8029a
commit e661020dc8
11 changed files with 18 additions and 26 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules/
node_modules/
dist/bundle.js*

View File

@ -3,7 +3,7 @@
"start": "webpack serve --config webpack.dev.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/",
"deploy": "gh-pages -d dist -t true"
"deploy": "webpack --config webpack.prod.js && gh-pages -d dist -t true"
},
"devDependencies": {
"@babel/preset-react": "^7.12.13",

View File

@ -5,13 +5,13 @@ import { OrbitControls } from './OrbitControls'
import { TrackballControls } from './trackball'
import { Sketcher } from './sketcher/Sketcher'
import Stats from './stats.module.js';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom'
import React from 'react'
import { createStore, applyMiddleware } from 'redux'
import { Root } from './app.jsx'
function main(store) {
var stats = new Stats();
stats.showPanel(0); // 0: fps, 1: ms, 2: mb, 3+: custom
@ -114,13 +114,11 @@ console.log(store.getState())
// main(store);
main(store);
document.addEventListener('DOMContentLoaded', () => {
const root = document.getElementById('react');
ReactDOM.render(
React.createElement(Root, { store: store }, null)
, root
, document.getElementById('react')
);
});
});

View File

@ -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 { onHover, onDrag, onPick, onRelease } from './pickEvents'

View File

@ -1,6 +1,4 @@
import * as THREE from 'three/src/Three'
import { lineMaterial, pointMaterial } from './Sketcher'
export function addDimension(ent1, ent2, distance) {

View File

@ -1,5 +1,4 @@
import * as THREE from 'three/src/Three'
import * as THREE from '../../node_modules/three/src/Three';
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 mesh = new THREE.Mesh(geometry, phong);
this.add(mesh)
this.dispatchEvent({ type: 'change' })
// this.sketch.visible = false
}

View File

@ -1,4 +1,4 @@
import * as THREE from 'three/src/Three'
import * as THREE from '../../node_modules/three/src/Three';
export function onHover(e) {
if (this.mode || e.buttons) return

View File

@ -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'
export function sketchArc(mouseLoc) {

View File

@ -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'
export function sketchLine(mouseLoc) {

File diff suppressed because one or more lines are too long

View File

@ -3,9 +3,7 @@ const path = require('path');
module.exports = {
entry: './src/index.js',
plugins: [
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
@ -30,7 +28,7 @@ module.exports = {
use: {
loader: 'babel-loader',
options: {
presets: ["@babel/preset-react"]
presets: ["@babel/preset-react"],
}
}
},
@ -38,7 +36,7 @@ module.exports = {
},
resolve: {
extensions: ['.js', '.jsx', '*']
}
},
};