From f3418d0aae72cfc1c37b38db38f202565ee6c475 Mon Sep 17 00:00:00 2001 From: Northword Date: Sun, 23 Feb 2025 14:01:59 +0800 Subject: [PATCH] fix: migrate to esm --- package.json | 1 + src/addon.ts | 3 +-- tsconfig.json | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7436f18..c3517c1 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "zotero-plugin-template", + "type": "module", "version": "3.0.3", "description": "Zotero Plugin Template", "config": { diff --git a/src/addon.ts b/src/addon.ts index ed9cf96..54f276b 100644 --- a/src/addon.ts +++ b/src/addon.ts @@ -1,6 +1,5 @@ import { config } from "../package.json"; -import { ColumnOptions } from "zotero-plugin-toolkit/dist/helpers/virtualizedTable"; -import { DialogHelper } from "zotero-plugin-toolkit/dist/helpers/dialog"; +import { ColumnOptions, DialogHelper } from "zotero-plugin-toolkit"; import hooks from "./hooks"; import { createZToolkit } from "./utils/ztoolkit"; diff --git a/tsconfig.json b/tsconfig.json index 2347a08..191b0f3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,16 @@ { "compilerOptions": { - "experimentalDecorators": true, - "module": "commonjs", "target": "ES2016", + "lib": ["ESNext"], + "experimentalDecorators": true, + "module": "ESNext", + "moduleResolution": "bundler", "resolveJsonModule": true, - "skipDefaultLibCheck": true, - "strict": true + "types": ["zotero-types"], + "strict": true, + "outDir": "build/dist/", + "skipLibCheck": true }, - "include": ["src", "typings", "node_modules/zotero-types"], + "include": ["src", "typings"], "exclude": ["build", "addon"] }