0.1.3 • Published 5 months ago
@lynx-js/webpack-dev-transport v0.1.3
A webpack devServer transport implementation for Lynx.
Client
The client transport can be used in the
devServer.client.webSocketTransport
configuration of webpack.config.js
.
// Copyright 2024 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { createRequire } from 'node:module';
import { LynxTransportServer } from '@lynx-js/webpack-dev-transport';
const require = createRequire(import.meta.url);
export default {
devServer: {
client: {
webSocketTransport: require.resolve(
'@lynx-js/webpack-dev-transport/client',
),
},
},
};
Server
The server transport can be used in the
devServer.webSocketServer
configuration of webpack.config.js
.
// Copyright 2024 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { LynxTransportServer } from '@lynx-js/webpack-dev-transport';
export default {
devServer: {
allowedHosts: 'all', // disable host checks, which Lynx does not support
webSocketServer: LynxTransportServer,
},
};