-
-
Notifications
You must be signed in to change notification settings - Fork 256
Open
Labels
Description
I'm trying to use latest 8.0.20-no-serial-port version in an ESM project
It does indeed require serialport in multiple occasions, making the whole package less portable (I'm bundling a Node app with Bun compilation)
These are the lines that force a dependency on serialport:
Line 21 in 94c1a3e
| const { SerialPort } = require("serialport"); |
Line 1240 in 94c1a3e
| require("./apis/connection")(ModbusRTU); |
Lines 1256 to 1258 in 94c1a3e
| try { | |
| module.exports.RTUBufferedPort = require("./ports/rtubufferedport"); | |
| } catch (err) { } |
Lines 1264 to 1265 in 94c1a3e
| module.exports.ServerTCP = require("./servers/servertcp"); | |
| module.exports.ServerSerial = require("./servers/serverserial"); |
Dunno if something changed recently or the package just isn't optimized to be executed within ESM projects