Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

npm version can not be used as a module #16

Open
elmerbulthuis opened this issue Nov 12, 2015 · 3 comments
Open

npm version can not be used as a module #16

elmerbulthuis opened this issue Nov 12, 2015 · 3 comments

Comments

@elmerbulthuis
Copy link
Contributor

Using requirejs, using the follwing configuration for the package:

"packages": [{
    "name": "ix",
    "main": "ix.js"
}]

now when I try to require ix, it will try and fetch Ix.js because this is references from the ix library.

This seems to be causing trouble:

    define(['Ix', 'exports'], function (Ix, exports) {

By renaming Ix to ix, the proper files get loaded, but I get a

Uncaught TypeError: Cannot read property 'isEqual' of undefined

I just use the l2o.js script, which is fine. What is the ix.js script for anyway?

I think moving the l2o to a seperate repository, keeping the name lowercase would solve all problems. I really love Linq and I use l2o a lot. It would be great if there was more development in the project. Maybe a different repo can also achieve that.

@Igorbek
Copy link

Igorbek commented Nov 12, 2015

The following fix for #8 worked for me:
image

@patsissons
Copy link

If you are using webpack then you can setup a resolve alias from Ix to l2o. There is probably an easy way to do this without webpack too.

resolve: {
    alias: {
      Ix: 'ix/l2o', // the ix package uses Ix to refer to l2o for some reason
    }
}

@elmerbulthuis
Copy link
Contributor Author

what exactly is the purpose of ix.js? I am actually only using l2o. I use

require('ix/l2o')

with the mopackage configuration in require like I mentioned.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants