project files:

  • index.html :

    <!DOCTYPE html> <html> <head> <script src="test.js "></script> </head> <body> <h1> Hallo World! </h1> </body> 

  • test.js :

     "use strict"; var superagent = require('superagent'); superagent.get('/testRequest'); 

The problem is that the browser can not cause require.

Advise the decision, please.

  • thanks) exactly what you need, but I have already decided to build the library at index.html) - Senyaak

0