From 41164ddeaf3be1eebdf6a0f16fd2330917263c6a Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 6 Jul 2021 03:31:10 +0300 Subject: [PATCH] clean catalogs --- app/.gitignore | 2 +- app/index.html | 2 +- {app/js => js}/buttons.js | 0 {app/js => js}/draw.js | 0 {app/js => js}/game.js | 0 {app/js => js}/index.bak.js | 0 {app/js => js}/index.js | 4 ++-- package.json | 5 +++-- webpack.config.js | 12 ++++++++---- 9 files changed, 15 insertions(+), 10 deletions(-) rename {app/js => js}/buttons.js (100%) rename {app/js => js}/draw.js (100%) rename {app/js => js}/game.js (100%) rename {app/js => js}/index.bak.js (100%) rename {app/js => js}/index.js (98%) diff --git a/app/.gitignore b/app/.gitignore index bd7c4a1..72cc074 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,2 +1,2 @@ -dist/ +engine.js assets/images/*.jpg diff --git a/app/index.html b/app/index.html index faa50a6..693b4db 100644 --- a/app/index.html +++ b/app/index.html @@ -10,6 +10,6 @@ - + diff --git a/app/js/buttons.js b/js/buttons.js similarity index 100% rename from app/js/buttons.js rename to js/buttons.js diff --git a/app/js/draw.js b/js/draw.js similarity index 100% rename from app/js/draw.js rename to js/draw.js diff --git a/app/js/game.js b/js/game.js similarity index 100% rename from app/js/game.js rename to js/game.js diff --git a/app/js/index.bak.js b/js/index.bak.js similarity index 100% rename from app/js/index.bak.js rename to js/index.bak.js diff --git a/app/js/index.js b/js/index.js similarity index 98% rename from app/js/index.js rename to js/index.js index fce4a32..dfbfc40 100644 --- a/app/js/index.js +++ b/js/index.js @@ -1,7 +1,7 @@ 'use strict'; -import config from '../config.json'; // game configuration -import gameData from '../gameData.json'; // game data +import config from '../app/config.json'; // game configuration +import gameData from '../app/gameData.json'; // game data import { getMousePos, isInside } from './buttons.js'; import { clearContext, getCenterH, getCenterV } from './draw.js'; diff --git a/package.json b/package.json index 1b3c80b..d5a0ca5 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,10 @@ "name": "quizEngine", "version": "0.0.1", "description": "", - "main": "index.js", + "main": "./js/engine.js", "scripts": { - "build": "webpack", + "start": "webpack serve", + "build": "webpack --mode=production", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { diff --git a/webpack.config.js b/webpack.config.js index 8b749b5..8e77f62 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,11 +1,15 @@ const path = require('path'); module.exports = { - entry: './js/index.js', - context: path.resolve(__dirname, 'app'), mode: 'development', + entry: './js/index.js', output: { - path: path.resolve(__dirname, 'app/dist'), - filename: 'game.js', + path: path.resolve(__dirname, 'app'), + filename: 'engine.js', + }, + devServer: { + contentBase: path.join(__dirname, 'app'), + compress: false, + port: 55555, }, };