Skip to content

Commit

Permalink
chore: fix entries
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Aug 30, 2021
1 parent 4b19d35 commit 6e62765
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"main": "dist/index.js",
"module": "dist/index.esm.js",
"scripts": {
"build": "rollup -c",
"build": "rollup -c && cp -r ./src/entries ./dist/entries",
"format": "prettier --write \"**/*.{js,json,md}\" \"*.{js,json,md}\"",
"lint": "eslint .",
"prepublishOnly": "yarn build",
Expand Down
File renamed without changes.
12 changes: 5 additions & 7 deletions src/entry-devserver.js → src/entries/devserver.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* global __resourceQuery */

import querystring from 'querystring'
import url from 'url'
import SockJS from 'sockjs-client'
import formatWebpackMessages from 'react-dev-utils/formatWebpackMessages'
import { reportBuildError, dismissBuildError } from 'react-error-overlay'
Expand All @@ -12,12 +11,11 @@ if (typeof __resourceQuery === 'string' && __resourceQuery) {
}

const connection = new SockJS(
url.format({
protocol: window.location.protocol,
hostname: sockOptions.sockHost || window.location.hostname,
port: sockOptions.sockPort || window.location.port,
pathname: sockOptions.sockPath || '/sockjs-node',
}),
`${window.location.protocol}//${
sockOptions.sockHost || window.location.hostname
}:${sockOptions.sockPort || window.location.port}${
sockOptions.sockPath || '/sockjs-node'
}`,
)

connection.onmessage = function onmessage(e) {
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import errorOverlayMiddleware from 'react-dev-utils/errorOverlayMiddleware'
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware')

const chunkPathBasic = require.resolve('./entry-basic')
const chunkPathDevServer = require.resolve('./entry-devserver')
const chunkPathBasic = require.resolve('./entries/basic')
const chunkPathDevServer = require.resolve('./entries/devserver')

class ErrorOverlayPlugin {
apply(compiler) {
Expand Down

0 comments on commit 6e62765

Please sign in to comment.