From a8c4df8744ac0d9e6a889af3ad3dcbd3e100ee0a Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Thu, 23 Dec 2021 17:19:52 +0100 Subject: chore: Add license headers Centralizes vite configuration to be able to add license banners to outputs in one place. --- packages/main/src/devTools.ts | 20 ++++++++++++++++++++ packages/main/src/index.ts | 20 ++++++++++++++++++++ packages/main/src/stores/RootStore.ts | 20 ++++++++++++++++++++ packages/main/vite.config.js | 21 ++++----------------- 4 files changed, 64 insertions(+), 17 deletions(-) (limited to 'packages/main') diff --git a/packages/main/src/devTools.ts b/packages/main/src/devTools.ts index d02bfbf..b98974a 100644 --- a/packages/main/src/devTools.ts +++ b/packages/main/src/devTools.ts @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2021-2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + import type { App, BrowserWindow } from 'electron'; /** diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index dbe6890..90102a7 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2021-2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { app, BrowserWindow } from 'electron'; import { getSnapshot, onPatch } from 'mobx-state-tree'; import { join } from 'path'; diff --git a/packages/main/src/stores/RootStore.ts b/packages/main/src/stores/RootStore.ts index a9c1290..edc740c 100644 --- a/packages/main/src/stores/RootStore.ts +++ b/packages/main/src/stores/RootStore.ts @@ -1,3 +1,23 @@ +/* + * Copyright (C) 2021-2022 Kristóf Marussy + * + * This file is part of Sophie. + * + * Sophie is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Instance, types } from 'mobx-state-tree'; import { sharedStore } from '@sophie/shared'; diff --git a/packages/main/vite.config.js b/packages/main/vite.config.js index 556fcf8..62e5f48 100644 --- a/packages/main/vite.config.js +++ b/packages/main/vite.config.js @@ -2,9 +2,7 @@ import { builtinModules } from 'module'; -// `resolveJsonModule` is disabled for this package, but vite will load the json nevertheless. -// @ts-expect-error -import { node } from '../../.electron-vendors.cache.json'; +import { makeConfig, node } from '../../config/vite-common'; /** @type string */ const PACKAGE_ROOT = __dirname; @@ -13,16 +11,10 @@ const PACKAGE_ROOT = __dirname; * @type {import('vite').UserConfig} * @see https://vitejs.dev/config/ */ -const config = { - mode: process.env.MODE, +const config = makeConfig({ root: PACKAGE_ROOT, - envDir: process.cwd(), build: { - sourcemap: 'inline', - target: `node${node}`, - outDir: 'dist', - assetsDir: '.', - minify: process.env.MODE !== 'development', + target: node, lib: { entry: 'src/index.ts', formats: ['cjs'], @@ -33,13 +25,8 @@ const config = { 'electron-devtools-installer', ...builtinModules, ], - output: { - entryFileNames: '[name].cjs', - }, }, - emptyOutDir: true, - brotliSize: false, }, -}; +}); export default config; -- cgit v1.2.3-54-g00ecf