Skip to content

Commit 1e7c738

Browse files
committed
feat: Build entrypoints and output manfiest.json
1 parent f09ffbb commit 1e7c738

33 files changed

+1049
-94
lines changed

demo/common/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Document</title>
7+
<script type="module" src="../../utils/logger.ts"></script>
8+
</head>
9+
<body></body>
10+
</html>

demo/entrypoints/overlay.content.ts renamed to demo/entrypoints/overlay.content/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineContentScript, mountContentScriptUi } from 'exvite/client';
22
import browser from 'webextension-polyfill';
3+
import '../../common/style.css';
34

45
export default defineContentScript({
56
matches: ['*://*/*'],

demo/entrypoints/popup.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Popup</title>
7+
<link rel="stylesheet" href="../common/style.css" />
78
</head>
89
<body>
910
<p>Hello popup!</p>

demo/entrypoints/sandbox.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Document</title>
7+
<script type="module" src="../utils/logger.ts"></script>
8+
</head>
9+
<body></body>
10+
</html>

demo/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"name": "Demo Extension",
3+
"version": "1.0.0",
4+
"description": "Demo extension for exvite",
25
"type": "module",
36
"scripts": {
47
"dev": "pnpm -w build && exvite",

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
},
3535
"scripts": {
3636
"dev": "tsx src/cli.ts",
37-
"build": "run-s build:*",
38-
"build:js": "tsup src/index.ts --clean --sourcemap --dts --format esm,cjs",
37+
"build": "run-s -s build:*",
38+
"build:js": "tsup src/index.ts --sourcemap --dts --format esm,cjs",
3939
"build:cli": "tsup src/cli/index.ts -d dist/cli --sourcemap",
4040
"build:client": "tsup src/client/index.ts -d dist/client --sourcemap --dts --format esm,cjs",
4141
"format": "prettier --write .",
@@ -49,18 +49,22 @@
4949
"cac": "^6.7.14",
5050
"consola": "^3.1.0",
5151
"fast-glob": "^3.2.12",
52+
"filesize": "^10.0.7",
5253
"fs-extra": "^11.1.1",
5354
"jiti": "^1.18.2",
5455
"json5": "^2.2.3",
5556
"linkedom": "^0.14.26",
57+
"picocolors": "^1.0.0",
5658
"picomatch": "^2.3.1",
5759
"unimport": "^3.0.8",
58-
"vite": "^4.3.9"
60+
"vite": "^4.3.9",
61+
"webextension-polyfill": "^0.10.0"
5962
},
6063
"devDependencies": {
6164
"@types/fs-extra": "^11.0.1",
6265
"@types/node": "^20.3.1",
6366
"@types/picomatch": "^2.3.0",
67+
"@types/webextension-polyfill": "^0.10.0",
6468
"npm-run-all": "^4.1.5",
6569
"prettier": "^2.8.8",
6670
"pretty-quick": "^3.1.3",

pnpm-lock.yaml

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli/commands/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as exvite from '../..';
22

33
export async function dev(root: any, { mode, config }: any) {
4-
const server = await exvite.createServer({
4+
await exvite.createServer({
55
mode,
66
root,
77
configFile: config,

src/cli/commands/prepare.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { consola } from 'consola';
2-
import { createServer } from '../..';
32

43
export async function prepare(root: any, { mode, config }: any) {
54
consola.warn('exvite prepare: Not implemented');

0 commit comments

Comments
 (0)