A webpack dev-server transport implementation for Lynx
npm install @lynx-js/webpack-dev-transportA webpack devServer transport implementation for Lynx.
The client transport can be used in thedevServer.client.webSocketTransport
configuration of webpack.config.js.
``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';
const require = createRequire(import.meta.url);
export default {
devServer: {
client: {
webSocketTransport: require.resolve(
'@lynx-js/webpack-dev-transport/client',
),
},
},
};
`
The server transport can be used in the
devServer.webSocketServer
configuration of webpack.config.js.
`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,
},
};
``