Open raphael10-collab opened 3 years ago
I'm trying to include node-simple-xmpp in my Electron-React-Webpack-Typescrip app.
node-simple-xmpp
In webpack.config.js I've added xmpp:
webpack.config.js
xmpp
const xmpp = require("simple-xmpp"); externals: [ { 'utf-8-validate': 'commonjs utf-8-validate', bufferutil: 'commonjs bufferutil', }, { 'xmpp': xmpp, } ],
But still I get require is not defined when adding these lines in a tsx file:
require is not defined
tsx
import xmpp from 'simple-xmpp';
xmpp.connect({ jid: "", password: "", host: "", port: 5280 });
How to resolve the problem?
I'm trying to include
node-simple-xmpp
in my Electron-React-Webpack-Typescrip app.In
webpack.config.js
I've addedxmpp
:But still I get
require is not defined
when adding these lines in atsx
file:import xmpp from 'simple-xmpp';
How to resolve the problem?