Skip to content

Commit

Permalink
Remove vite-plugin-static-copy
Browse files Browse the repository at this point in the history
Also update README with updated instructions
  • Loading branch information
Coteh committed May 24, 2024
1 parent a5b352f commit 8168f92
Show file tree
Hide file tree
Showing 30 changed files with 31 additions and 28 deletions.
45 changes: 28 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,39 @@ Simple clone of the well-known Minesweeper game. Created using JavaScript, Node.
![In-Game](screenshots/game.png "In-Game")

## Installation
To run the game locally, simply run the following to install dependencies:
```
npm install
```
To run the game locally, follow these steps:

Then run the following to build the game:
```
npm run build
```
1. **Install Dependencies**

You can then run a local server on the `build` directory and open it on your browser to play. eg:
Run the following command to install the necessary dependencies:
```sh
npm install
```

```
python -m http.server 8000 -d build
2. **Build the Game**

# then open http://localhost:8000 to play locally
```
Use the following command to build the game:
```sh
npm run build
```

You can also run the following to run the game in development mode:
```
npm run dev
```
3. **Serve the Game Locally**

Run a local server to serve the contents of the build directory and open the game in your browser:
```sh
npm run serve
```

Then open http://localhost:4173 to play the game locally.

4. **Development Mode**

To run the game in development mode, use the following command:
```sh
npm run dev
```

Then open http://localhost:5173 to play the game locally in development mode. The game will reload on changes in the source.

## Issues
- Unit and Integration testing is limited
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<title>MinesweeperClone</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<div id="content" class="container"></div>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"dev": "vite serve",
"build": "vite build",
"serve": "vite preview",
"format": "prettier --config ./.prettierrc --write .",
"test": "node --experimental-vm-modules node_modules/jest-cli/bin/jest.js"
},
Expand All @@ -20,8 +21,7 @@
"dependencies": {
"pixi.js": "4.3.0",
"vite": "^5.2.11",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-static-copy": "^1.0.5"
"vite-plugin-node-polyfills": "^0.22.0"
},
"devDependencies": {
"jest-cli": "^29.7.0",
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
8 changes: 0 additions & 8 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { defineConfig } from 'vite';
import path from "path";
import { version } from './package.json';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

export default defineConfig({
Expand All @@ -20,13 +19,6 @@ export default defineConfig({
}
},
plugins: [
// TODO: "Before you use this plugin, consider using public directory or import in JavaScript. In most cases, these will work."
viteStaticCopy({
targets: [
{ src: 'img/', dest: '.' },
{ src: 'style.css', dest: '.' },
]
}),
nodePolyfills(),
]
})

0 comments on commit 8168f92

Please sign in to comment.