New guests can be added, returning players recognised, and games are saved properly, locking the board. Changed webpack config to compile typescript with babel.

This commit is contained in:
Daniel Ledda
2020-05-25 22:52:10 +02:00
parent f08105c39f
commit 5342b7a48e
14 changed files with 333 additions and 157 deletions

View File

@@ -1,51 +1,51 @@
const path = require("path");
const webpack = require("webpack");
const Settings = require("./package.json");
const SERVER_ROOT = Settings.serverRoot;
module.exports = {
entry: "./src/index.tsx",
mode: "production",
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /(node_modules|bower_components|\.d\.ts$)/,
use: [
{
loader: "babel-loader",
options: { presets: ["@babel/env"] },
},
{ loader: "ts-loader" },
],
},
{
test: /\.d\.ts$/,
loader: 'ignore-loader'
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
},
{
test: /\.(png|jpe?g|gif|ttf|woff2?|eot|svg)$/i,
use: [
{
loader: 'file-loader',
},
],
}
]
},
resolve: { extensions: [".tsx", ".ts", ".js", "*"] },
output: {
path: path.resolve(__dirname, "dist/"),
publicPath: "/kadi/static/game/",
filename: "bundle.js"
},
devServer: {
contentBase: path.join(__dirname, "public/"),
port: 3000,
publicPath: "http://localhost:3000/",
hotOnly: true
},
plugins: [new webpack.HotModuleReplacementPlugin()]
entry: ["@babel/polyfill", "./src/index.tsx"],
mode: "production",
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /(node_modules|bower_components|\.d\.ts$)/,
use: [
"react-hot-loader/webpack",
"babel-loader",
],
},
{
test: /\.d\.ts$/,
loader: 'ignore-loader'
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
},
{
test: /\.(png|jpe?g|gif|ttf|woff2?|eot|svg)$/i,
use: [
{
loader: 'file-loader',
},
],
}
]
},
resolve: { extensions: [".tsx", ".ts", ".js", "*"] },
output: {
path: path.resolve(__dirname, "dist/"),
publicPath: SERVER_ROOT + "/static/game/",
filename: "bundle.js"
},
devServer: {
contentBase: path.join(__dirname, "public/"),
contentBasePublicPath: SERVER_ROOT + "/",
port: 3000,
publicPath: "http://localhost:3000" + SERVER_ROOT + "/static/game/",
hotOnly: true
},
plugins: [new webpack.HotModuleReplacementPlugin()]
};