diff --git a/README.md b/README.md index cc05e28..c36266f 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,9 @@ https://dutchcelt.github.io/tictactoe/ ### NPM Script Options -Run the game, run tests or run in development mode +Run the game, run tests, run in development mode, or run a build. - `npm run game` - `npm test` - `npm run develop` +- `npm run build` diff --git a/src/index.html b/index.html similarity index 100% rename from src/index.html rename to index.html diff --git a/src/main.js b/main.js similarity index 100% rename from src/main.js rename to main.js diff --git a/package.json b/package.json index de82435..3165152 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "tictactoe", "version": "1.0.2", - "main": "src/index.html", + "main": "index.html", "type": "module", "scripts": { - "build": "vite build './src' --base='tictactoe' --outDir='../dist'", - "game": "vite src --base=tictactoe --open", + "build": "vite build", + "game": "vite --open", "develop": "npm run game & ava --verbose --watch ", "test": "c8 ava" }, diff --git a/src/scripts/board.js b/scripts/board.js similarity index 100% rename from src/scripts/board.js rename to scripts/board.js diff --git a/src/scripts/board.spec.js b/scripts/board.spec.js similarity index 100% rename from src/scripts/board.spec.js rename to scripts/board.spec.js diff --git a/src/scripts/event.spec.js b/scripts/event.spec.js similarity index 100% rename from src/scripts/event.spec.js rename to scripts/event.spec.js diff --git a/src/scripts/events.js b/scripts/events.js similarity index 100% rename from src/scripts/events.js rename to scripts/events.js diff --git a/src/scripts/logic.js b/scripts/logic.js similarity index 100% rename from src/scripts/logic.js rename to scripts/logic.js diff --git a/src/scripts/logic.spec.js b/scripts/logic.spec.js similarity index 100% rename from src/scripts/logic.spec.js rename to scripts/logic.spec.js diff --git a/src/scripts/moves.js b/scripts/moves.js similarity index 100% rename from src/scripts/moves.js rename to scripts/moves.js diff --git a/src/scripts/moves.spec.js b/scripts/moves.spec.js similarity index 100% rename from src/scripts/moves.spec.js rename to scripts/moves.spec.js diff --git a/src/scripts/state.js b/scripts/state.js similarity index 100% rename from src/scripts/state.js rename to scripts/state.js diff --git a/src/scripts/state.spec.js b/scripts/state.spec.js similarity index 100% rename from src/scripts/state.spec.js rename to scripts/state.spec.js diff --git a/src/scripts/tictactoe.js b/scripts/tictactoe.js similarity index 100% rename from src/scripts/tictactoe.js rename to scripts/tictactoe.js diff --git a/src/scripts/tictactoe.spec.js b/scripts/tictactoe.spec.js similarity index 100% rename from src/scripts/tictactoe.spec.js rename to scripts/tictactoe.spec.js diff --git a/src/styles/tictactoe.css.js b/styles/tictactoe.css.js similarity index 100% rename from src/styles/tictactoe.css.js rename to styles/tictactoe.css.js diff --git a/src/vars/const.js b/vars/const.js similarity index 100% rename from src/vars/const.js rename to vars/const.js diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..0b87377 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,9 @@ +import { resolve } from 'path'; +import { defineConfig } from 'vite'; + +export default defineConfig({ + base: '/tictactoe/', + build: { + minify: true, + }, +}); diff --git a/web-dev-server.config.js b/web-dev-server.config.js deleted file mode 100644 index ea145a1..0000000 --- a/web-dev-server.config.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - https://modern-web.dev/docs/dev-server/cli-and-configuration/ -*/ - -export default { - // whether to open the browser and/or the browser path to open on - open: true, - - // index HTML to use for SPA routing / history API fallback - appIndex: '/index.html', - - // run in watch mode, reloading when files change - watch: true, - - // resolve bare module imports - nodeResolve: false, - - // JS language target to compile down to using esbuild. Recommended value is "auto", which compiles based on user agent. - // esbuildTarget: 'auto', - - // preserve symlinks when resolve imports, instead of following symlinks to their original files - // preserveSymlinks: boolean, - - // the root directory to serve files from. this is useful in a monorepo - // when executing commands from a package - rootDir: './src', - - // prefix to strip from request urls - // basePath: string, - - /** - * Whether to log debug messages. - */ - // debug: boolean, - - // files to serve with a different mime type - // mimeTypes: MimeTypeMappings, - - // middleware used by the server to modify requests/responses, for example to proxy requests or rewrite urls - // middleware: Middleware[], - - // plugins used by the server to serve or transform files - // plugins: Plugin[], - - // configuration for the server - protocol: 'https', - - // hostname?: string, - port: 9009, - - // whether to run the server with HTTP2 - http2: true, - - // path to SSL key - // sslKey: string, - - // path to SSL certificate - // sslCert: string, -};