include.js icon indicating copy to clipboard operation
include.js copied to clipboard

NPM package?

Open nkovacic opened this issue 8 years ago • 6 comments

I could not find this loader on npm? Would be very useful if it was uploaded on it.

nkovacic avatar Feb 20 '17 12:02 nkovacic

As include.js does not support node module loading, I don't think it's worth putting it on NPM. But maybe i'm wrong ! Any idea ?

CapMousse avatar Feb 20 '17 14:02 CapMousse

I wanted to you use it for client side external library lazy loading (Youtube api, google maps,...). Because of continous deployment it better if the library can be loaded from package managers (NPM and bower).

nkovacic avatar Feb 20 '17 15:02 nkovacic

You can install non npm package with npm with npm install [email protected]:CapMousse/include.js.git --save. It will create a "include.js": "git+ssh://[email protected]/CapMousse/include.js.git" line in your package list :)

CapMousse avatar Feb 20 '17 20:02 CapMousse

Hey. I have a problem... I installed the dep as you offered above. After that I imported in a constructor of class of my React app:

    this.include = require('../../node_modules/include.js/include.js');

Then I got my js file from apache and I had 200 OK:

this.include.include(['http://localhost:81/validator/validate.js'], function (d) {
    console.log(d);
}

And d receives 1. Do you have a guess what happened? Thank you in advance

pitronalldak avatar May 08 '17 16:05 pitronalldak

I didn't try to use Include with React/NPM. Maybe it doesn't like to be "included". I will check that.

CapMousse avatar May 14 '17 20:05 CapMousse

So, i'm working on a "npm friendly" version of Include.js. Some works need to be done to enable loading the module. So : soon™

CapMousse avatar May 28 '17 17:05 CapMousse