Skip to content

Commit 653d857

Browse files
committed
Convert background and content scripts to modules
1 parent dbf9c9a commit 653d857

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "react-typescript-chrome-extension-boilerplate",
3-
"version": "0.1.0",
3+
"description": "Minimal boilerplate for making chrome extensions using React and TypeScript",
4+
"version": "1.0.0",
45
"private": true,
56
"dependencies": {
67
"@craco/craco": "^6.4.3",

src/scripts/background.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
console.log("yo");
1+
import { capitalize } from "../utils";
22

3-
export {};
3+
console.log(capitalize("hello from the background script!"));

src/scripts/content.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
console.log("yo");
1+
import { capitalize } from "../utils";
22

3-
export {};
3+
console.log(capitalize("hello from the content script!"));

src/utils.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const capitalize = (s: string) =>
2+
s.slice(0, 1).toUpperCase().concat(s.slice(1).toLowerCase());

0 commit comments

Comments
 (0)