0.1.0 • Published 8 months ago
@lynx-dev/webpack-dev-transport v0.1.0
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-dev/webpack-dev-transport';
const require = createRequire(import.meta.url);
export default {
devServer: {
client: {
webSocketTransport: require.resolve(
'@lynx-dev/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-dev/webpack-dev-transport';
export default {
devServer: {
allowedHosts: 'all', // disable host checks, which Lynx does not support
webSocketServer: LynxTransportServer,
},
};