From 2c6b9c2091ff76f07a6dbc4cd2c7d14298f3c9f5 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 30 Aug 2023 14:53:27 -0700 Subject: ci(docker): use bun through and through --- Dockerfile | 12 +++++----- bun.lockb | Bin 82786 -> 83144 bytes package.json | 65 ++++++++++++++++++++++++++++--------------------------- svelte.config.js | 9 ++++++-- 4 files changed, 46 insertions(+), 40 deletions(-) diff --git a/Dockerfile b/Dockerfile index a905fa2f..6546e768 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,21 @@ -FROM node:18.16-alpine as build +FROM oven/bun as build WORKDIR /due COPY package.json ./ -RUN yarn install +RUN bun install COPY ./ ./ -RUN yarn run build +RUN bun run build -FROM node:18.16-alpine +FROM oven/bun WORKDIR /due COPY --from=build /due . -EXPOSE 4173 +EXPOSE 3000 -CMD ["yarn", "run", "preview", "--", "--host", "0.0.0.0"] \ No newline at end of file +CMD ["bun", "./build/index.js"] \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 63def48d..9574ad77 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index c7fa6c3a..ce097e10 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,35 @@ { - "name": "due.moe", - "version": "0.0.0", - "private": true, - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "prettier --plugin-search-dir . --check . && eslint .", - "format": "prettier --plugin-search-dir . --write ." - }, - "devDependencies": { - "@sveltejs/adapter-auto": "^2.0.0", - "@sveltejs/kit": "^1.20.4", - "@typescript-eslint/eslint-plugin": "^5.45.0", - "@typescript-eslint/parser": "^5.45.0", - "eslint": "^8.28.0", - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-svelte": "^2.30.0", - "prettier": "^2.8.0", - "prettier-plugin-svelte": "^2.10.1", - "svelte": "^4.0.5", - "svelte-check": "^3.4.3", - "tslib": "^2.4.1", - "typescript": "^5.0.0", - "vite": "^4.4.2" - }, - "type": "module", - "dependencies": { - "dexie": "^4.0.1-alpha.25" - } + "name": "due.moe", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --plugin-search-dir . --check . && eslint .", + "format": "prettier --plugin-search-dir . --write ." + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^2.0.0", + "@sveltejs/kit": "^1.20.4", + "@typescript-eslint/eslint-plugin": "^5.45.0", + "@typescript-eslint/parser": "^5.45.0", + "eslint": "^8.28.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-svelte": "^2.30.0", + "prettier": "^2.8.0", + "prettier-plugin-svelte": "^2.10.1", + "svelte": "^4.0.5", + "svelte-adapter-bun": "^0.5.0", + "svelte-check": "^3.4.3", + "tslib": "^2.4.1", + "typescript": "^5.0.0", + "vite": "^4.4.2" + }, + "type": "module", + "dependencies": { + "dexie": "^4.0.1-alpha.25" + } } diff --git a/svelte.config.js b/svelte.config.js index 1cf26a00..28de0ccd 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from 'svelte-adapter-bun'; import { vitePreprocess } from '@sveltejs/kit/vite'; /** @type {import('@sveltejs/kit').Config} */ @@ -11,7 +11,12 @@ const config = { // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. // If your environment is not supported or you settled on a specific environment, switch out the adapter. // See https://kit.svelte.dev/docs/adapters for more information about adapters. - adapter: adapter() + adapter: adapter({ + precompress: { + brotli: true, + gzip: true, + }, + }) } }; -- cgit v1.2.3