Skip to content

Commit

Permalink
🐛 fix: 优化判断当前文档的定位方案 close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
frostime committed Jul 9, 2024
1 parent 6b5aa5d commit 65861c1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sy-bookmark-plus",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"description": "A more powerful bookmark",
"repository": "",
Expand All @@ -10,6 +10,7 @@
"scripts": {
"make-link": "node --no-warnings ./scripts/make_dev_link.js",
"dev": "vite build --watch",
"dev-srcmap": "vite build --watch --sourcemap=inline",
"build": "vite build",
"make-install": "vite build && node --no-warnings ./scripts/make_install.js"
},
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "sy-bookmark-plus",
"author": "frostime",
"url": "https://github.com/frostime/sy-bookmark-plus",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "3.0.12",
"backends": [
"windows",
Expand Down
4 changes: 3 additions & 1 deletion src/components/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ const Group: Component<Props> = (props) => {
label: i18n_.currentdoc,
icon: "iconAdd",
click: () => {
const li = document.querySelector(
let wnd = document.querySelector('div.layout__wnd--active[data-type="wnd"]');
if (!wnd) return;
const li = wnd.querySelector(
"ul.layout-tab-bar>li.item--focus"
);
if (!li) return;
Expand Down
21 changes: 8 additions & 13 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import fg from 'fast-glob';

import vitePluginYamlI18n from './yaml-plugin';

const args = minimist(process.argv.slice(2))
const isWatch = args.watch || args.w || false
const devDistDir = "dev"
const distDir = isWatch ? devDistDir : "dist"
const args = minimist(process.argv.slice(2));
const isWatch = args.watch || args.w || false;
const isSrcmap = args.sourcemap || false;
const devDistDir = "dev";
const distDir = isWatch ? devDistDir : "dist";

console.log("isWatch=>", isWatch)
console.log("distDir=>", distDir)
console.log("isWatch=>", isWatch);
console.log("isSrcmap=>", isSrcmap);

export default defineConfig({
resolve: {
Expand Down Expand Up @@ -72,13 +73,7 @@ export default defineConfig({
outDir: distDir,
emptyOutDir: false,

sourcemap: isWatch ? 'inline' : false,

// 设置为 false 可以禁用最小化混淆
// 或是用来指定是应用哪种混淆器
// boolean | 'terser' | 'esbuild'
// 不压缩,用于调试
minify: !isWatch,
minify: !isWatch || (isWatch && (isSrcmap === 'inline')),

lib: {
// Could also be a dictionary or array of multiple entry points
Expand Down

0 comments on commit 65861c1

Please sign in to comment.