mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
/// <reference types='vitest' />
|
|
import { join } from 'path';
|
|
import { defineConfig } from 'vite';
|
|
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
|
|
|
const assets = [ "assets", "stylesheets", "libraries", "fonts", "translations" ];
|
|
|
|
export default defineConfig(() => ({
|
|
root: __dirname,
|
|
cacheDir: '../../node_modules/.vite/apps/client',
|
|
server: {
|
|
port: 4200,
|
|
host: 'localhost',
|
|
},
|
|
preview: {
|
|
port: 4300,
|
|
host: 'localhost',
|
|
},
|
|
plugins: [
|
|
viteStaticCopy({
|
|
targets: assets.map((asset) => ({
|
|
src: `src/${asset}/**/*`,
|
|
dest: asset
|
|
}))
|
|
})
|
|
],
|
|
// Uncomment this if you are using workers.
|
|
// worker: {
|
|
// plugins: [ nxViteTsPaths() ],
|
|
// },
|
|
build: {
|
|
target: "esnext",
|
|
outDir: './dist',
|
|
emptyOutDir: true,
|
|
reportCompressedSize: true,
|
|
rollupOptions: {
|
|
input: {
|
|
desktop: join(__dirname, "src", "desktop.ts"),
|
|
mobile: join(__dirname, "src", "mobile.ts"),
|
|
login: join(__dirname, "src", "login.ts"),
|
|
setup: join(__dirname, "src", "setup.ts"),
|
|
share: join(__dirname, "src", "share.ts"),
|
|
set_password: join(__dirname, "src", "set_password.ts"),
|
|
},
|
|
output: {
|
|
entryFileNames: "[name].js",
|
|
chunkFileNames: "[name].js",
|
|
assetFileNames: "[name].js"
|
|
}
|
|
}
|
|
},
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true,
|
|
}
|
|
}));
|