I am using feathersjs as restful API and primusjs as websocket connection. Below is the code I am using to generate primus.js file:
app.configure(primus({
transformer: 'websockets',
timeout: false
}, (primus) => {
primus.library();
primus.save(path.join(__dirname, '../public/dist/primus.js'));
}))
In order to let my client to use the generated primus.js
file. I have to serve this file from my server. From the client side, it can use it like below:
<script src='http://xxxxxx/public/dist/primus.js'>
But my client is using webpack to package every dependencies into a few big js files. How can I package primus.js
file in client if it is an auto generated file?