Skip to content

Commit b133847

Browse files
committed
feat: use tsup
1 parent 62305ee commit b133847

File tree

12 files changed

+37
-55
lines changed

12 files changed

+37
-55
lines changed

.vscodeignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ src/**
77
.yarnrc
88
vsc-extension-quickstart.md
99
**/tsconfig.json
10-
**/.eslintrc.json
10+
**/pnpm-lock.yaml
11+
**/.prettierrc.js
12+
**/.prettierignore
13+
**/tsup.config.js
14+
**/.oxlintrc.json
1115
**/*.map
1216
**/*.ts

package.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,9 @@
198198
},
199199
"scripts": {
200200
"vscode:prepublish": "npm run package",
201-
"compile:clear": "rimraf dist && rimraf media",
202-
"compile:style": "esbuild --loader:.woff=file --loader:.woff2=file --loader:.ttf=file --bundle --minify src/view/style/style.css --outfile=media/style.css",
203-
"compile:view": "esbuild src/view/view.ts --bundle --minify --outfile=media/view.js",
204-
"compile:main": "tsup",
205-
"compile": "pnpm run compile:clear && pnpm run compile:style && pnpm run compile:view && pnpm run compile:main",
206-
"watch:style": "esbuild src/view/style/style.css --watch --loader:.woff=file --loader:.woff2=file --loader:.ttf=file --bundle --outfile=media/style.css",
207-
"watch:view": "esbuild src/view/view.ts --watch --bundle --sourcemap --outfile=media/view.js",
208-
"watch:main": "tsup --watch src",
209-
"watch": "concurrently -n view,style,main \"pnpm run watch:view\" \"pnpm run watch:style\" \"pnpm run watch:main\"",
210-
"package": "npm run compile:clear && npm run compile:view && npm run compile:style && tsup",
211-
"tsc": "tsc --noEmit",
201+
"compile": "tsup",
202+
"package": "tsup",
203+
"watch": "tsup --watch src",
212204
"pretest": "npm run tsc && npm run lint",
213205
"lint:ox": "oxlint -c .oxlintrc.json",
214206
"lint:ox:fix": "oxlint -c .oxlintrc.json --fix",

postcss.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/template.html.ts renamed to src/main/template.html.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import * as vscode from 'vscode';
33
import { getNonce } from './get-nonce';
44

55
export const getHtmlTemplateForWebView = (webview: vscode.Webview, extensionUri: vscode.Uri) => {
6-
const getMediaUri = (fileName: string) =>
7-
webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'media', fileName));
6+
const getMediaUri = (fileName: string) => webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'dist', fileName));
87

9-
const scriptUri = getMediaUri('view.js');
8+
const scriptUri = getMediaUri('view.global.js');
109
const styleUri = getMediaUri('style.css');
1110
const nonce = getNonce();
1211

src/view/utils/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/* Copyright 2021, Milkdown by Mirone.*/
22

33
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4-
export const vscode = (globalThis as any).acquireVsCodeApi();
4+
export const vscode = (window as any).acquireVsCodeApi();

tailwind.config.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)