FishOrBear 7 years ago
commit 70d1cea5da

63
.gitignore vendored

@ -1,2 +1,61 @@
/node_modules # Logs
node_modules logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
#custom
.vscode

@ -10,8 +10,6 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@types/dat-gui": "^0.6.2",
"@types/node": "^7.0.18",
"add-asset-html-webpack-plugin": "^2.0.1", "add-asset-html-webpack-plugin": "^2.0.1",
"awesome-typescript-loader": "^3.1.3", "awesome-typescript-loader": "^3.1.3",
"bootstrap-loader": "^2.1.0", "bootstrap-loader": "^2.1.0",
@ -28,12 +26,17 @@
"webpack-dev-server": "^2.4.5" "webpack-dev-server": "^2.4.5"
}, },
"dependencies": { "dependencies": {
"@types/node": "^7.0.18",
"@types/dat-gui": "^0.6.2", "@types/dat-gui": "^0.6.2",
"@types/lodash": "^4.14.64", "@types/lodash": "^4.14.64",
"@types/react": "^15.0.24",
"@types/react-dom": "^15.5.0",
"@types/stats.js": "^0.16.0", "@types/stats.js": "^0.16.0",
"@types/three": "^0.84.7", "@types/three": "^0.84.7",
"dat.gui": "^0.6.1", "dat.gui": "^0.6.1",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"stats.js": "^0.17.0", "stats.js": "^0.17.0",
"three": "^0.85.2" "three": "^0.85.2"
} }

@ -0,0 +1,3 @@
import * as React from "react";
export interface HelloProps { compiler: string; framework: string; }
export const Hello = (props: HelloProps) => <h1>Hello from {props.compiler} and {props.framework}!</h1>;

@ -1,7 +0,0 @@
import { Application, Application2 } from "./Application";
window.onload = function ()
{
new Application2();
};

@ -0,0 +1,19 @@
import { Application, Application2 } from "./Application";
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Hello } from "./UI/demo";
ReactDOM.render(
<Hello compiler="TypeScript" framework="React" />,
document.body
);
window.onload = function () {
new Application2();
};

@ -9,7 +9,9 @@
], ],
"types": [ "types": [
"node" "node"
] ],
"module": "commonjs",
"jsx": "react"
}, },
"include": [ "include": [
"./src/**/*", "./src/**/*",

@ -3,7 +3,7 @@ var HtmlWebPackPlugin = require("html-webpack-plugin");
var AddAssetHtmlPlugin = require("add-asset-html-webpack-plugin"); var AddAssetHtmlPlugin = require("add-asset-html-webpack-plugin");
const webpack = require('webpack'); const webpack = require('webpack');
module.exports = { module.exports = {
entry: "./src/index.ts", entry: "./src/index.tsx",
output: { output: {
filename: "bundle.js", filename: "bundle.js",
path: path.resolve(__dirname, 'dist') path: path.resolve(__dirname, 'dist')
@ -16,7 +16,7 @@ module.exports = {
"stats-js": path.resolve(__dirname, './node_modules/stats.js/src/stats.js') "stats-js": path.resolve(__dirname, './node_modules/stats.js/src/stats.js')
}, },
// Add '.ts' and '.tsx' as resolvable extensions. // Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"] extensions: [".ts", ".tsx", ".js","json"]
}, },
module: { module: {
@ -44,6 +44,10 @@ module.exports = {
// { test: /\.js$/, loader: "source-map-loader" } // { test: /\.js$/, loader: "source-map-loader" }
// ] // ]
}, },
// externals: {
// "react": "React",
// "react-dom": "ReactDOM"
// },
// Other options... // Other options...
devServer: { devServer: {
contentBase: path.join(__dirname, "dist"), contentBase: path.join(__dirname, "dist"),

Loading…
Cancel
Save