Skip to content

Commit

Permalink
Tweaked OS support
Browse files Browse the repository at this point in the history
  • Loading branch information
transkatgirl committed Oct 3, 2024
1 parent 5f24d10 commit 43bf94c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Portal is an app built for independent learners.

Unlike most eLearning applications, Portal is focused on making use of existing learning materials. Any textbook or set of textbooks can be converted into a Portal course, as long as it is available in the EPUB format.

Portal is designed to perform well on low-end hardware and does not require an internet connection to use. It can run on all desktop [platforms supported by Tauri](https://github.com/tauri-apps/tauri#platforms).
Portal is designed to perform well on low-end hardware and does not require an internet connection to use. It can run on Windows >= 7, macOS >= 12, and popular Linux distributions.

<details>

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"@tauri-apps/cli": "^2.0.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^22.7.4",
"@vitejs/plugin-legacy": "^5.4.2",
"browserslist": "^4.24.0",
"eslint": "^9.11.1",
"globals": "^15.10.0",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
},
"macOS": {
"minimumSystemVersion": "10.13"
"minimumSystemVersion": "12.0"
},
"linux": {
"deb": {
Expand Down
30 changes: 11 additions & 19 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { defineConfig } from "vite";
import eslint from "vite-plugin-eslint";
import browserslist from "browserslist";
import { browserslistToTargets } from "lightningcss";
import legacy from "@vitejs/plugin-legacy";
import { createHtmlPlugin } from "vite-plugin-html";
import { createWriteStream, existsSync, mkdirSync } from "fs";

Expand All @@ -16,14 +15,6 @@ if (!existsSync("node_modules/jszip/dist/jszip.js")) {
writeStream.end();
}

// Tauri uses Edge on Windows and WebKit on macOS and Linux
const targets =
process.env.TAURI_ENV_PLATFORM == "windows" ? "edge>=89" : "safari>=11";

// Consider browser versions released since 2023 as modern
const modernTargets =
process.env.TAURI_ENV_PLATFORM == "windows" ? "edge>=109" : "safari>=16.3";

export default defineConfig({
// prevent vite from obscuring rust errors
clearScreen: false,
Expand All @@ -42,6 +33,8 @@ export default defineConfig({
"TAURI_ENV_DEBUG",
],
build: {
// Tauri uses Edge on Windows and WebKit on macOS and Linux
target: process.env.TAURI_ENV_PLATFORM == "windows" ? "edge89" : "safari15",
minify: "terser",
cssMinify: "lightningcss",
rollupOptions: {
Expand All @@ -59,16 +52,15 @@ export default defineConfig({
css: {
transformer: "lightningcss",
lightningcss: {
targets: browserslistToTargets(browserslist(targets)),
targets: browserslistToTargets(
browserslist(
// Tauri uses Edge on Windows and WebKit on macOS and Linux
process.env.TAURI_ENV_PLATFORM == "windows"
? "edge>=89"
: "safari>=15",
),
),
},
},
plugins: [
eslint(),
legacy({
targets,
additionalLegacyPolyfills: [],
modernTargets,
}),
createHtmlPlugin({ minify: true }),
],
plugins: [eslint(), createHtmlPlugin({ minify: true })],
});

0 comments on commit 43bf94c

Please sign in to comment.