Now Rollup scripts into one (somewhat large ;) ) file
This commit is contained in:
parent
04ace65942
commit
d428eb3efe
9
build.sh
9
build.sh
|
@ -1,10 +1,15 @@
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
mkdir -p dist/server
|
mkdir -p dist/server
|
||||||
mkdir -p dist/www/
|
mkdir -p dist/www/
|
||||||
|
echo "Compiling SCSS......."
|
||||||
scss client/scss/main.scss dist/www/style.css
|
scss client/scss/main.scss dist/www/style.css
|
||||||
cp -r client/www/* dist/www
|
|
||||||
rm -rf .sass-cache
|
rm -rf .sass-cache
|
||||||
|
echo "Moving Static Webpage object to www......"
|
||||||
|
cp -r client/www/* dist/www
|
||||||
|
echo "Rolling up ES6 Modules into bundle......"
|
||||||
|
npx rollup -c
|
||||||
|
echo "Compiling TypeScript"
|
||||||
npx tsc
|
npx tsc
|
||||||
echo "Starting server......."
|
echo "Starting server......."
|
||||||
echo "~-+/\________________/==o=O=o==\________________/\+-~"
|
echo "$(tput setaf 3)~-+/\________________/==o=O=o==\________________/\+-~$(tput setaf 8)"
|
||||||
node dist/server/main.js
|
node dist/server/main.js
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import {tileArray} from './tileRenderer.js';
|
import {tileArray} from './tileRenderer.js';
|
||||||
import { cursor } from '../interface/game/mouse.js'
|
|
||||||
import { ctx} from './html.js';
|
import { ctx} from './html.js';
|
||||||
import { game } from '../game/game.js'
|
import { game } from '../game/game.js'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {game} from "/scripts/game/game.js"
|
import {game} from "../game/game.js"
|
||||||
|
|
||||||
export const tileArray = loadSprites('/img/mine.png', game.tileSize);
|
export const tileArray = loadSprites('/img/mine.png', game.tileSize);
|
||||||
var counter = 0;
|
var counter = 0;
|
4
client/scripts/index.js
Normal file
4
client/scripts/index.js
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
import './display/draw.js';
|
||||||
|
import './game/game.js'
|
||||||
|
import './interface/mainmenu/menu.js'
|
||||||
|
import './net/netcode.js'
|
|
@ -1,5 +1,5 @@
|
||||||
import {game} from "../../game/game.js";
|
import {game} from "../../game/game.js";
|
||||||
import { clickCanvas } from "/scripts/net/netcode.js";
|
import { clickCanvas } from "../../net/netcode.js";
|
||||||
import { canvas } from "../../display/html.js"
|
import { canvas } from "../../display/html.js"
|
||||||
|
|
||||||
class Cursor {
|
class Cursor {
|
|
@ -1,10 +1,10 @@
|
||||||
import {joinGame, createGame} from "/scripts/net/netcode.js"
|
import {joinGame, createGame} from "../../net/netcode.js"
|
||||||
import { changeScene } from "/scripts/interface/scene.js"
|
import { changeScene } from "../scene.js"
|
||||||
import {Picker} from "./picker.js"
|
import {Picker} from "./picker.js"
|
||||||
import {tileArray, menuArray} from "/scripts/display/tileRenderer.js"
|
import {tileArray, menuArray} from "../../display/tileRenderer.js"
|
||||||
import * as util from "/scripts/util.js"
|
import * as util from "../../util.js"
|
||||||
import {ID} from "/scripts/util.js"
|
import {ID} from "../../util.js"
|
||||||
import * as status from "/scripts/net/status.js"
|
import * as status from "../../net/status.js"
|
||||||
|
|
||||||
var menuPicker, colorPicker;
|
var menuPicker, colorPicker;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as status from "../../net/status.js"
|
import * as status from "../../net/status.js"
|
||||||
import {joinGame, createGame} from "/scripts/net/netcode.js"
|
// import {joinGame, createGame} from "../../net/netcode.js"
|
||||||
import { changeScene } from "/scripts/interface/scene.js"
|
import { changeScene } from "../scene.js"
|
||||||
import * as createMenu from "./create.js"
|
import * as createMenu from "./create.js"
|
||||||
|
|
||||||
function ID(id) {
|
function ID(id) {
|
|
@ -1,9 +1,9 @@
|
||||||
import * as env from "/scripts/env.js"
|
import * as env from "../env.js"
|
||||||
import * as status from "/scripts/net/status.js"
|
import * as status from "./status.js"
|
||||||
import {game} from "/scripts/game/game.js"
|
import {game} from "../game/game.js"
|
||||||
import {render} from "/scripts/display/draw.js"
|
import {render} from "../display/draw.js"
|
||||||
import { changeScene } from "/scripts/interface/scene.js"
|
import { changeScene } from "../interface/scene.js"
|
||||||
import { illegalAction } from "/scripts/interface/common/illegalaction.js"
|
import { illegalAction } from "../interface/common/illegalaction.js"
|
||||||
|
|
||||||
export var socket = io.connect(env.IP_ADDRESS);
|
export var socket = io.connect(env.IP_ADDRESS);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {updateConnectionStatus} from "/scripts/interface/game/connection.js"
|
import {updateConnectionStatus} from "../interface/game/connection.js"
|
||||||
|
|
||||||
var SERVER_CONNECTION = "disconnected"
|
var SERVER_CONNECTION = "disconnected"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<script src="http://localhost:35729/livereload.js" charset="utf-8"></script>
|
<script src="http://localhost:35729/livereload.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="socket.io.min.js"></script>
|
<script type="text/javascript" src="socket.io.min.js"></script>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<script src='scripts/script.js' type="module"></script>
|
<script src='index.js' type="module"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- Canvas used to generate individual sprites off one sprite atlas -->
|
<!-- Canvas used to generate individual sprites off one sprite atlas -->
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
import '/scripts/display/draw.js';
|
|
||||||
import '/scripts/game/game.js'
|
|
||||||
import '/scripts/interface/mainmenu/menu.js'
|
|
||||||
import "/scripts/net/netcode.js"
|
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -10,7 +10,6 @@
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"rollup": "^2.75.7",
|
|
||||||
"sass": "^1.52.3",
|
"sass": "^1.52.3",
|
||||||
"socket.io": "^4.5.0",
|
"socket.io": "^4.5.0",
|
||||||
"ts-node": "^10.8.1",
|
"ts-node": "^10.8.1",
|
||||||
|
@ -19,7 +18,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node16": "^1.0.3",
|
"@tsconfig/node16": "^1.0.3",
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"@types/node": "^18.0.0"
|
"@types/node": "^18.0.0",
|
||||||
|
"rollup": "^2.75.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@cspotcode/source-map-support": {
|
"node_modules/@cspotcode/source-map-support": {
|
||||||
|
@ -906,6 +906,7 @@
|
||||||
"version": "2.75.7",
|
"version": "2.75.7",
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.7.tgz",
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.7.tgz",
|
||||||
"integrity": "sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==",
|
"integrity": "sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==",
|
||||||
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"rollup": "dist/bin/rollup"
|
"rollup": "dist/bin/rollup"
|
||||||
},
|
},
|
||||||
|
@ -1924,6 +1925,7 @@
|
||||||
"version": "2.75.7",
|
"version": "2.75.7",
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.7.tgz",
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.7.tgz",
|
||||||
"integrity": "sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==",
|
"integrity": "sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==",
|
||||||
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"fsevents": "~2.3.2"
|
"fsevents": "~2.3.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"rollup": "^2.75.7",
|
|
||||||
"sass": "^1.52.3",
|
"sass": "^1.52.3",
|
||||||
"socket.io": "^4.5.0",
|
"socket.io": "^4.5.0",
|
||||||
"ts-node": "^10.8.1",
|
"ts-node": "^10.8.1",
|
||||||
|
@ -24,6 +23,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node16": "^1.0.3",
|
"@tsconfig/node16": "^1.0.3",
|
||||||
|
"rollup": "^2.75.7",
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"@types/node": "^18.0.0"
|
"@types/node": "^18.0.0"
|
||||||
}
|
}
|
||||||
|
|
9
rollup.config.js
Normal file
9
rollup.config.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
export default {
|
||||||
|
input: 'client/scripts/index.js',
|
||||||
|
output: [
|
||||||
|
{
|
||||||
|
file: 'dist/www/index.js',
|
||||||
|
format: 'iife'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
Loading…
Reference in a new issue