mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
chore(dx/client): get vite build to work
This commit is contained in:
parent
f3f7ff5622
commit
f4a56d4e19
@ -72,6 +72,9 @@
|
|||||||
"script-loader": "0.7.2",
|
"script-loader": "0.7.2",
|
||||||
"vite-plugin-static-copy": "3.1.2"
|
"vite-plugin-static-copy": "3.1.2"
|
||||||
},
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "vite build"
|
||||||
|
},
|
||||||
"nx": {
|
"nx": {
|
||||||
"name": "client",
|
"name": "client",
|
||||||
"targets": {
|
"targets": {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
import { join, resolve } from 'path';
|
import { join, resolve } from 'path';
|
||||||
import { defineConfig, type Plugin } from 'vite';
|
import { defineConfig, type Plugin } from 'vite';
|
||||||
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
||||||
import asset_path from './src/asset_path';
|
|
||||||
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
|
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
|
||||||
import preact from "@preact/preset-vite";
|
import preact from "@preact/preset-vite";
|
||||||
|
|
||||||
@ -11,15 +10,7 @@ const assets = [ "assets", "stylesheets", "fonts", "translations" ];
|
|||||||
export default defineConfig(() => ({
|
export default defineConfig(() => ({
|
||||||
root: __dirname,
|
root: __dirname,
|
||||||
cacheDir: '../../node_modules/.vite/apps/client',
|
cacheDir: '../../node_modules/.vite/apps/client',
|
||||||
base: process.env.NODE_ENV === "production" ? "" : asset_path,
|
base: "",
|
||||||
server: {
|
|
||||||
port: 4200,
|
|
||||||
host: 'localhost',
|
|
||||||
},
|
|
||||||
preview: {
|
|
||||||
port: 4300,
|
|
||||||
host: 'localhost',
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
preact(),
|
preact(),
|
||||||
viteStaticCopy({
|
viteStaticCopy({
|
||||||
@ -58,10 +49,6 @@ export default defineConfig(() => ({
|
|||||||
"preact/hooks"
|
"preact/hooks"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// Uncomment this if you are using workers.
|
|
||||||
// worker: {
|
|
||||||
// plugins: [ nxViteTsPaths() ],
|
|
||||||
// },
|
|
||||||
build: {
|
build: {
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
outDir: './dist',
|
outDir: './dist',
|
||||||
@ -100,18 +87,6 @@ export default defineConfig(() => ({
|
|||||||
"./src/test/setup.ts"
|
"./src/test/setup.ts"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
optimizeDeps: {
|
|
||||||
exclude: [
|
|
||||||
"@triliumnext/highlightjs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
css: {
|
|
||||||
preprocessorOptions: {
|
|
||||||
scss: {
|
|
||||||
quietDeps: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
commonjsOptions: {
|
commonjsOptions: {
|
||||||
transformMixedEsModules: true,
|
transformMixedEsModules: true,
|
||||||
},
|
},
|
Loading…
x
Reference in New Issue
Block a user