Skip to content

Commit

Permalink
fix: ws connection will be created in production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pacexy committed Aug 17, 2021
1 parent 884dfdd commit 31924a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"build": "tsc"
},
"files": [
"out",
"content.js",
"background.js"
"./out/**",
"./content.js",
"./background.js"
],
"devDependencies": {
"@types/chrome": "^0.0.146",
Expand Down
3 changes: 1 addition & 2 deletions src/content.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { isDev, Message, PORT } from './utils'

const ws = new WebSocket(`ws://localhost:${PORT}`)

if (isDev) {
const ws = new WebSocket(`ws://localhost:${PORT}`)
ws.addEventListener('message', (event) => {
if (event.data === Message.FileChange) {
chrome.runtime.sendMessage(Message.Reload)
Expand Down

0 comments on commit 31924a5

Please sign in to comment.