Skip to content

Commit

Permalink
fix: undefined config during build (#158)
Browse files Browse the repository at this point in the history
* fix: undefined version config

* chore: lint fix

* chore: revert auto-lint fix change
  • Loading branch information
Anush008 authored Jun 3, 2023
1 parent dde39f1 commit c986086
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/content-scripts/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void processGithubPage();
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
switch (msg.type) {
case "get_highlight": {
const title = (document.querySelector(".js-issue-title.markdown-title") as HTMLHeadingElement)?.innerText;
const title = (document.querySelector(".js-issue-title.markdown-title") as HTMLHeadingElement).innerText;

sendResponse(title);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "react-icons/hi2";
import { goBack } from "react-chrome-extension-router";
import { VscIssues } from "react-icons/vsc";
const { version } = config;
import { version } from "../../package.json";

const Help = () => (
<div className="p-4 bg-slate-800">
Expand Down
3 changes: 1 addition & 2 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/// <reference types="vite/client" />
declare var config: Record<string, string>;
/// <reference types="vite/client" />
5 changes: 1 addition & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ import manifest from "./manifest.json" assert { type: "json" };

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), crx({ manifest })],
define: {
'config.version': JSON.stringify(process.env.npm_package_version),
}
plugins: [react(), crx({ manifest })]
});

0 comments on commit c986086

Please sign in to comment.