Skip to content

Commit

Permalink
add parse5-utils as a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Oct 24, 2020
1 parent dc0b931 commit 30df6e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/dev-server-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"mime-types": "^2.1.27",
"parse5": "^6.0.0",
"picomatch": "^2.2.2",
"ws": "^7.3.1"
"ws": "^7.3.1",
"@web/parse5-utils": "^1.0.0"
},
"devDependencies": {
"@types/clone": "^0.1.30",
Expand Down
4 changes: 2 additions & 2 deletions packages/dev-server-core/src/web-sockets/webSocketsPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Plugin } from '../Plugin';
import { NAME_WEB_SOCKET_IMPORT } from './WebSocketsManager';
import { appendToDocument } from '@web/parse5-utils';
import parseUtils = require('@web/parse5-utils');

export const webSocketScript = `<!-- injected by web-dev-server -->
<script type="module" src="${NAME_WEB_SOCKET_IMPORT}"></script>`;
Expand Down Expand Up @@ -89,7 +89,7 @@ if (webSocket) {

async transform(context) {
if (context.response.is('html')) {
return appendToDocument(context.body, webSocketScript);
return parseUtils.appendToDocument(context.body, webSocketScript);
}
},
};
Expand Down

0 comments on commit 30df6e0

Please sign in to comment.