mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
format: run prettify
This commit is contained in:
+50
-40
@@ -1,49 +1,49 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { join, resolve } from 'path';
|
||||
import { defineConfig } from "vite";
|
||||
import { join, resolve } from "path";
|
||||
|
||||
import touchGlobalCSSPlugin from './lib/touchGlobalCSS';
|
||||
import InlineWorkerPlugin from './lib/inlineWorker';
|
||||
import { base64Loader } from './lib/base64loader';
|
||||
import type { BuildTarget } from './lib/types';
|
||||
import ClosePlugin from './lib/closePlugin';
|
||||
import touchGlobalCSSPlugin from "./lib/touchGlobalCSS";
|
||||
import InlineWorkerPlugin from "./lib/inlineWorker";
|
||||
import { base64Loader } from "./lib/base64loader";
|
||||
import type { BuildTarget } from "./lib/types";
|
||||
import ClosePlugin from "./lib/closePlugin";
|
||||
|
||||
import million from "million/compiler";
|
||||
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||
|
||||
import { chrome } from './src/manifests/chrome';
|
||||
import { brave } from './src/manifests/brave';
|
||||
import { edge } from './src/manifests/edge';
|
||||
import { firefox } from './src/manifests/firefox';
|
||||
import { opera } from './src/manifests/opera';
|
||||
import { safari } from './src/manifests/safari';
|
||||
import { crx } from '@crxjs/vite-plugin';
|
||||
import { chrome } from "./src/manifests/chrome";
|
||||
import { brave } from "./src/manifests/brave";
|
||||
import { edge } from "./src/manifests/edge";
|
||||
import { firefox } from "./src/manifests/firefox";
|
||||
import { opera } from "./src/manifests/opera";
|
||||
import { safari } from "./src/manifests/safari";
|
||||
import { crx } from "@crxjs/vite-plugin";
|
||||
|
||||
const targets: BuildTarget[] = [
|
||||
chrome, brave, edge, firefox, opera, safari
|
||||
]
|
||||
const targets: BuildTarget[] = [chrome, brave, edge, firefox, opera, safari];
|
||||
|
||||
const mode = process.env.MODE || 'chrome'; // Check the environment variable to determine which build type to use.
|
||||
const mode = process.env.MODE || "chrome"; // Check the environment variable to determine which build type to use.
|
||||
//const sourcemap = (process.env.SOURCEMAP === "true") || false; // Check whether we want sourcemaps.
|
||||
export default defineConfig(({ command }) => ({
|
||||
plugins: [
|
||||
base64Loader,
|
||||
InlineWorkerPlugin(),
|
||||
svelte({
|
||||
emitCss: false
|
||||
emitCss: false,
|
||||
}),
|
||||
million.vite({ auto: true }),
|
||||
crx({
|
||||
manifest: targets.find(t => t.browser === mode.toLowerCase())?.manifest ?? chrome.manifest,
|
||||
browser: mode.toLowerCase() === "firefox" ? "firefox" : "chrome"
|
||||
manifest:
|
||||
targets.find((t) => t.browser === mode.toLowerCase())?.manifest ??
|
||||
chrome.manifest,
|
||||
browser: mode.toLowerCase() === "firefox" ? "firefox" : "chrome",
|
||||
}),
|
||||
touchGlobalCSSPlugin(),
|
||||
...(command === 'build' ? [ClosePlugin()] : [])
|
||||
...(command === "build" ? [ClosePlugin()] : []),
|
||||
],
|
||||
root: resolve(__dirname, './src'),
|
||||
root: resolve(__dirname, "./src"),
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve(__dirname, './src')
|
||||
"@": resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
@@ -51,36 +51,46 @@ export default defineConfig(({ command }) => ({
|
||||
hmr: {
|
||||
host: "localhost",
|
||||
protocol: "ws",
|
||||
port: 5173
|
||||
}
|
||||
port: 5173,
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
api: 'modern'
|
||||
}
|
||||
}
|
||||
api: "modern",
|
||||
},
|
||||
},
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: ['@babel/runtime/helpers/extends', '@babel/runtime/helpers/interopRequireDefault'],
|
||||
include: [
|
||||
"@babel/runtime/helpers/extends",
|
||||
"@babel/runtime/helpers/interopRequireDefault",
|
||||
],
|
||||
},
|
||||
legacy: {
|
||||
skipWebSocketTokenCheck: true,
|
||||
},
|
||||
worker: {
|
||||
format: 'es',
|
||||
format: "es",
|
||||
},
|
||||
build: {
|
||||
outDir: resolve(__dirname, 'dist', mode),
|
||||
outDir: resolve(__dirname, "dist", mode),
|
||||
emptyOutDir: false,
|
||||
minify: false,
|
||||
//sourcemap: sourcemap,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
settings: join(__dirname, 'src', 'interface', 'index.html'),
|
||||
migration: join(__dirname, 'src', 'seqta', 'utils', 'migration', 'migrate.html'),
|
||||
pageState: join(__dirname, 'src', 'pageState.js'),
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
settings: join(__dirname, "src", "interface", "index.html"),
|
||||
migration: join(
|
||||
__dirname,
|
||||
"src",
|
||||
"seqta",
|
||||
"utils",
|
||||
"migration",
|
||||
"migrate.html",
|
||||
),
|
||||
pageState: join(__dirname, "src", "pageState.js"),
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user