mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(vite): use base path
This commit is contained in:
parent
6286c39381
commit
e536ec4cbf
@ -2,12 +2,14 @@
|
||||
import { join } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
||||
import asset_path from './src/asset_path';
|
||||
|
||||
const assets = [ "assets", "stylesheets", "libraries", "fonts", "translations" ];
|
||||
|
||||
export default defineConfig(() => ({
|
||||
root: __dirname,
|
||||
cacheDir: '../../node_modules/.vite/apps/client',
|
||||
base: "/" + asset_path,
|
||||
server: {
|
||||
port: 4200,
|
||||
host: 'localhost',
|
||||
|
@ -1,4 +1,3 @@
|
||||
import assetPath from "./asset_path.js";
|
||||
import { isDev } from "./utils.js";
|
||||
|
||||
export default isDev ? assetPath + "/src" : assetPath + "/app-dist";
|
||||
export default assetPath + "/src";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import packageJson from "../../package.json" with { type: "json" };
|
||||
import { isDev } from "./utils";
|
||||
|
||||
const assetPath = isDev ? `http://localhost:4200` : `assets/v${packageJson.version}`;
|
||||
const assetPath = isDev ? `http://localhost:4200/assets/v${packageJson.version}` : `assets/v${packageJson.version}`;
|
||||
|
||||
export default assetPath;
|
||||
|
Loading…
x
Reference in New Issue
Block a user