Create a web server to begin the Visions VTT application #110

Merged
savanni merged 4 commits from visions into main 2023-12-04 02:42:05 +00:00
7 changed files with 2066 additions and 0 deletions
Showing only changes of commit 778da0b651 - Show all commits

10
visions/ui/Makefile Normal file
View File

@ -0,0 +1,10 @@
release:
NODE_ENV=production npm run build
dev:
npm run build
server:
npx http-server ./dist

1991
visions/ui/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

24
visions/ui/package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "ui",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"author": "",
"license": "GPL-3.0-or-later",
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.4",
"copy-webpack-plugin": "^11.0.0",
"ts-loader": "^9.4.3",
"webpack": "^5.85.0",
"webpack-cli": "^5.1.3"
}
}

View File

@ -0,0 +1,6 @@
<!doctype html>
<html>
<body>
<div id="root"></div>
</body>
</html>

11
visions/ui/src/main.tsx Normal file
View File

@ -0,0 +1,11 @@
import React from "react";
import ReactDOM from "react-dom";
const App = () => <div>App</div>;
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);

View File

View File

@ -0,0 +1,24 @@
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
mode: "development",
entry: {
"main": "./src/main.tsx"
},
module: {
rules: [
{ test: /\.tsx?$/, use: "ts-loader", exclude: /node_modules/ }
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: "src/index.html" },
{ from: "src/visions.css" },
]
})
],
resolve: {
extensions: ['.ts', '.tsx'],
}
}