Skip to content

Commit 2d84d3b

Browse files
committed
changed file structure of extension
now the build folder is packed into the actual extension the contentscript and backgroundscript bundle files are now actually used in manifest.json removed unnecessary panel.css file
1 parent f22bed6 commit 2d84d3b

File tree

9 files changed

+29
-31
lines changed

9 files changed

+29
-31
lines changed

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
node_modules
22
.DS_Store
3-
dist/
4-
extension/bundle.js
5-
package/react-time-travel-1.0.1.tgz
3+
src/extension/build/bundles
4+
package/react-time-travel-*.tgz
65
tictactoe
7-
tictactoe/build/bundle.js
8-
tictactoe/package-lock.json
96
parents
107
coverage

src/app/styles/styles.scss

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
html {
2+
height: 100%;
3+
}
4+
5+
body {
6+
margin: 0;
7+
height: 100%;
8+
}
9+
10+
#root {
11+
height: 100%;
12+
}
13+
114
.main-container {
215
height: 100%;
316
margin: 0 auto;
@@ -11,9 +24,9 @@
1124
grid-template-columns: 1fr 2fr;
1225
grid-template-rows: 8fr 1fr;
1326
grid-template-areas:
14-
'actions states'
15-
'travel travel'
16-
'buttons buttons';
27+
"actions states"
28+
"travel travel"
29+
"buttons buttons";
1730
}
1831

1932
/* if extension width is less than 500px, stack the body containers */
@@ -22,10 +35,10 @@
2235
grid-template-rows: 3fr 5fr 1fr;
2336
grid-template-columns: auto;
2437
grid-template-areas:
25-
'actions'
26-
'states'
27-
'travel'
28-
'buttons';
38+
"actions"
39+
"states"
40+
"travel"
41+
"buttons";
2942
}
3043
}
3144
.travel-container {

src/extension/devtools.html renamed to src/extension/build/devtools.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
<body>
1212
<script type="text/javascript" src="devtools.js"></script>
13-
</body>
13+
</body>
1414

1515
</html>
File renamed without changes.

src/extension/manifest.json renamed to src/extension/build/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
"manifest_version": 2,
77
"content_security_policy": "script-src 'self' 'unsafe-eval' ; object-src 'self'",
88
"background": {
9-
"scripts": ["background.js"],
9+
"scripts": ["bundles/background.bundle.js"],
1010
"persistent": false
1111
},
1212
"content_scripts": [
1313
{
1414
"matches": ["<all_urls>"],
15-
"js": ["contentScript.js"]
15+
"js": ["bundles/content.bundle.js"]
1616
}
1717
],
1818
"permissions": ["contextMenus", "tabs", "<all_urls>"]

src/extension/panel.html renamed to src/extension/build/panel.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<body>
1111
<div id="root"></div>
1212
<link rel="stylesheet" type="text/css" href="./styles/panel.css" />
13-
<script type="text/javascript" src="panel.js"></script>
14-
<script type="text/javascript" src="dist/app.bundle.js"></script>
13+
<script type="text/javascript" src="bundles/app.bundle.js"></script>
1514
</body>
1615
</html>

src/extension/panel.js

Whitespace-only changes.

src/extension/styles/panel.css

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

webpack.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ const config = {
55
entry: {
66
app: './src/app/index.js',
77
background: './src/extension/background.js',
8+
content: './src/extension/contentScript.js',
89
},
910
output: {
10-
path: path.resolve(__dirname, 'src/extension/dist'),
11+
path: path.resolve(__dirname, 'src/extension/build/bundles'),
1112
filename: '[name].bundle.js',
1213
},
1314
module: {
@@ -43,7 +44,7 @@ module.exports = (env, argv) => {
4344
config.plugins.push(
4445
new ChromeExtensionReloader({
4546
entries: {
46-
contentScript: ['app'],
47+
contentScript: ['app', 'content'],
4748
background: ['background'],
4849
},
4950
}),

0 commit comments

Comments
 (0)