- Created new `api` Django app with serializers, viewsets, and routers to expose draft sessions, participants, and movie data. - Registered `api` app in settings and updated root URL configuration. - Extended WebSocket consumers with `inform.draft_status` / `request.draft_status` to allow fetching current draft state. - Updated `DraftSession` and related models to support reverse lookups for draft picks. - Enhanced draft state manager to include `draft_order` in summaries. - Added React WebSocket context provider, connection status component, and new admin/participant panels with phase and participant tracking. - Updated SCSS for participant lists, phase indicators, and status badges. - Modified Django templates to mount new React roots for admin and participant views. - Updated Webpack dev server config to proxy WebSocket connections.
80 lines
2.1 KiB
JavaScript
80 lines
2.1 KiB
JavaScript
const path = require("path");
|
|
|
|
module.exports = {
|
|
entry: ["./src/index.js"],
|
|
output: {
|
|
filename: "bundle.js",
|
|
path: path.resolve(__dirname, "dist"),
|
|
publicPath: "http://localhost:3000/dist/", // webpack-dev-server URL
|
|
},
|
|
mode: "development",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|jsx)$/, // include .jsx files
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "babel-loader",
|
|
},
|
|
},
|
|
{
|
|
test: /\.scss$/,
|
|
use: [
|
|
"style-loader", // Injects styles into DOM
|
|
"css-loader", // Turns CSS into CommonJS
|
|
"sass-loader", // Compiles SCSS to CSS
|
|
],
|
|
},
|
|
{
|
|
test: /\.(woff2?|ttf|otf|eot)$/,
|
|
type: "asset/resource",
|
|
generator: {
|
|
filename: "fonts/[name][ext]",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
devServer: {
|
|
static: false,
|
|
hot: true,
|
|
port: 3000,
|
|
headers: {
|
|
"Access-Control-Allow-Origin": "*",
|
|
},
|
|
proxy: [
|
|
{
|
|
context: () => true,
|
|
target: "http://localhost:8000",
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
{
|
|
context: (pathname) => pathname.startsWith('/ws/'),
|
|
target: 'ws://localhost:8000',
|
|
ws: true, // <-- enable websocket proxying
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
],
|
|
},
|
|
ignoreWarnings: [
|
|
// Ignore all warnings from a specific file (e.g., Bootstrap's Sass)
|
|
{ message: /Deprecation Warning/ },
|
|
{ message: /repetitive deprecation warnings/ },
|
|
],
|
|
};
|
|
// module.exports = {
|
|
// // ... other webpack configurations
|
|
// ignoreWarnings: [
|
|
// // Ignore all warnings from a specific file (e.g., Bootstrap's Sass)
|
|
// { file: /_bootstrap\.scss$/, message: /^DEPRECATION WARNING/ },
|
|
|
|
// // Alternatively, ignore all warnings containing a specific string
|
|
// { message: /DEPRECATION WARNING: Sass\'s behavior for declarations/ },
|
|
|
|
// // Or, ignore warnings based on a general pattern
|
|
// // This example ignores all warnings from node_modules that are deprecation warnings
|
|
// { file: /node_modules/, message: /DEPRECATION WARNING/ },
|
|
// ],
|
|
// };
|