mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-25 10:33:21 +00:00
fix importing issue and unit test issue
This commit is contained in:
3 files changed
+12
-13
No files matched your search
@@ -2,6 +2,7 @@ import { defineConfig } from "vite";
|
|||||||
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { readFileSync } from "node:fs";
|
import { readFileSync } from "node:fs";
|
||||||
|
const resolve = (...args: string[]) => path.resolve(...args).replace(/\\/g, "/");
|
||||||
const packageJson = JSON.parse(readFileSync("../../../package.json", "utf-8"));
|
const packageJson = JSON.parse(readFileSync("../../../package.json", "utf-8"));
|
||||||
const manifestJson = JSON.parse(readFileSync("../../../manifest.json", "utf-8"));
|
const manifestJson = JSON.parse(readFileSync("../../../manifest.json", "utf-8"));
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
@@ -63,17 +64,14 @@ export default defineConfig({
|
|||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@lib/worker/bgWorker.ts": "../../lib/src/worker/bgWorker.mock.ts",
|
"@lib/worker/bgWorker.ts": "../../lib/src/worker/bgWorker.mock.ts",
|
||||||
"@lib/pouchdb/pouchdb-browser.ts": path.resolve(__dirname, "lib/pouchdb-node.ts"),
|
"@lib/pouchdb/pouchdb-browser.ts": resolve(__dirname, "lib/pouchdb-node.ts"),
|
||||||
// The CLI runs on Node.js; force AWS XML builder to its CJS Node entry
|
// The CLI runs on Node.js; force AWS XML builder to its CJS Node entry
|
||||||
// so Vite does not resolve the browser DOMParser-based XML parser.
|
// so Vite does not resolve the browser DOMParser-based XML parser.
|
||||||
"@aws-sdk/xml-builder": path.resolve(
|
"@aws-sdk/xml-builder": resolve(__dirname, "../../../node_modules/@aws-sdk/xml-builder/dist-cjs/index.js"),
|
||||||
__dirname,
|
|
||||||
"../../../node_modules/@aws-sdk/xml-builder/dist-cjs/index.js"
|
|
||||||
),
|
|
||||||
// Force fflate to the Node CJS entry; browser entry expects Web Worker globals.
|
// Force fflate to the Node CJS entry; browser entry expects Web Worker globals.
|
||||||
fflate: path.resolve(__dirname, "../../../node_modules/fflate/lib/node.cjs"),
|
fflate: resolve(__dirname, "../../../node_modules/fflate/lib/node.cjs"),
|
||||||
"@": path.resolve(__dirname, "../../"),
|
"@": resolve(__dirname, "../../"),
|
||||||
"@lib": path.resolve(__dirname, "../../lib/src"),
|
"@lib": resolve(__dirname, "../../lib/src"),
|
||||||
"../../src/worker/bgWorker.ts": "../../src/worker/bgWorker.mock.ts",
|
"../../src/worker/bgWorker.ts": "../../src/worker/bgWorker.mock.ts",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -85,7 +83,7 @@ export default defineConfig({
|
|||||||
minify: false,
|
minify: false,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: {
|
||||||
index: path.resolve(__dirname, "entrypoint.ts"),
|
index: resolve(__dirname, "entrypoint.ts"),
|
||||||
},
|
},
|
||||||
external: (id) => {
|
external: (id) => {
|
||||||
if (defaultExternal.includes(id)) return true;
|
if (defaultExternal.includes(id)) return true;
|
||||||
@@ -101,7 +99,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
lib: {
|
lib: {
|
||||||
entry: path.resolve(__dirname, "entrypoint.ts"),
|
entry: resolve(__dirname, "entrypoint.ts"),
|
||||||
formats: ["cjs"],
|
formats: ["cjs"],
|
||||||
fileName: "index",
|
fileName: "index",
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
Submodule src/lib updated: 6fac4a00dd...2171c5f55e.
@@ -15,7 +15,7 @@ export default mergeConfig(
|
|||||||
// maxConcurrency: 2,
|
// maxConcurrency: 2,
|
||||||
name: "unit-tests",
|
name: "unit-tests",
|
||||||
include: ["**/*unit.test.ts", "**/*.unit.spec.ts"],
|
include: ["**/*unit.test.ts", "**/*.unit.spec.ts"],
|
||||||
exclude: ["test/**", "src/apps/**"],
|
exclude: ["test/**", "src/apps/**/testdeno/**"],
|
||||||
coverage: {
|
coverage: {
|
||||||
include: ["src/**/*.ts"],
|
include: ["src/**/*.ts"],
|
||||||
exclude: [
|
exclude: [
|
||||||
@@ -25,7 +25,8 @@ export default mergeConfig(
|
|||||||
"test/**",
|
"test/**",
|
||||||
"src/lib/**/*.test.ts",
|
"src/lib/**/*.test.ts",
|
||||||
"**/_*",
|
"**/_*",
|
||||||
"src/apps/**",
|
"src/apps/**/testdeno/**",
|
||||||
|
// "src/apps/**",
|
||||||
// "src/cli/**",
|
// "src/cli/**",
|
||||||
"src/lib/src/cli/**",
|
"src/lib/src/cli/**",
|
||||||
"**/*_obsolete.ts",
|
"**/*_obsolete.ts",
|
||||||
|
|||||||
Reference in new issue
Block a user