-
-
Notifications
You must be signed in to change notification settings - Fork 255
Is there a way in my package.json to tell JSPM not to install a specific dependency? #1070
Comments
Hi @onlywei Yes indeed, using {
"name": "my-package",
"dependencies": {
"a": "^0.1.0",
"b": "^2.3.5"
},
"map": {
"b": "@empty"
}
} |
@aluanhaddad any idea if this is jspm 0.17.x only? We're on 0.16.47 and it's not working. |
@aluanhaddad the working example you have provided and the written example you gave are inconsistent. One is using "map" an the other is using "dependencies". Which one is correct? |
@onlywei I figured that out trying to answer @josephschmitt's question. Total fail on my part. "map": {
"dep": "@empty"
} works correctly and in both 0.17 and master. |
@aluanhaddad ok sorry, just to confirm, in the package with the dependency, I add this "map" key in the root of the package.json? Not inside "jspm"? So it would be: {
"name": "my-package",
"dependencies": {
"my-unwanted-dep": "1.0.0"
},
"map": {
"my-unwanted-dep": "@empty"
}
} |
Yes, just like you have it there. Note I tested with the master branch, not with 0.16.47. Sorry for the confusion. I'm going to leave this issue open to track that bug. |
@aluanhaddad ok. Doesn't seem to work with |
looking into it now |
@aluanhaddad I'm also experiencing that it does not work in the root nor nested in |
I just upgraded to |
@onlywei, @josephschmitt sorry for not replying sooner. I have created a package, to demonstrate that this works. You can find it at https://github.com/aluanhaddad/jspm-registry-1070 The package has two dependencies, jsdom, and jquery. I have used To test, run $ jspm install github:aluanhaddad/jspm-registry-1070 Observe that jsdom is not installed, but jquery is. Then run $ npm install aluanhaddad/jspm-registry-1070 Observe that jsdom and jquery are both installed. Let me know if this helps |
@aluanhaddad thanks, we were finally able to get this working for the most part, closing out this issue. However, I do want to bring attention to a new issue I'm going to create soon related to this. It seems that if we use this technique of setting Not sure if this project is the right place to file this issue, but I'll work on creating a stand-alone reproducible example in the mean time I can link you to. Thanks again for your help. |
@aluanhaddad here's the new issue I've filed #1072 Let me know if someone is able to help out. |
Yup this is definitely a bug. I'm not sure what the best fix would be though. Note that jspm 0.17 fixed up a lot of these sorts of mapping cases, it may be worth trying that version if you can. |
For example, can I do something like this in my
package.json
?Such that when I do
jspm install npm:my-package
, I also want JSPM to install "a", but not "b"?The text was updated successfully, but these errors were encountered: