Dok11
July 1, 2021, 9:23pm
1
I have directory
/node_modules — by default
/local_node_modules — I made it
and wanna use @babylonjs /core from local directory as it explained in article How to NPM Link to a local version of your dependency | by _Aid(); | Medium
So as I readed I should open “/local_node_modules/@babylonjs ” and run git clone GitHub - BabylonJS/Babylon.js: Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
But! File structure in the repository and my folder ("/node_modules/@babylonjs /core") doesnt match. It looks like in the node modules folder I have content from Babylon.js/src at master · BabylonJS/Babylon.js · GitHub
Does anyone know how I can make local copy of @babylonjs /core to custom it for my project?
fork the project and locally run a full build with npm run build this will deploy as npm link all the babylon libs.
Then in any other projects just use npm link @babylonjs /… to reuse the local one
1 Like
Dok11
July 8, 2021, 7:54am
3
Thank you for answer!
I has question about license. As I can see it is Apache 2.0 and I should state changes.
How it can be implemented? Push changes to public fork of repo?
This is a good question as I thought we picked apache 2.0 so you can do whatever you want with it
Obviously we like when users add a little thanks somewhere but nothing is mandatory.
Adding @Deltakosh to confirm
1 Like
Seb is right, you can do the heck you want even though we appreciate when people can contribute back
2 Likes
Dok11
July 16, 2021, 9:06pm
6
My friends, I’sorry, but I still confused to use “npm link” with babylonjs. If you can pleas check my actions and comment it where I was mistakes:
Create folder structure
/my-project
/node_modules
/node_modules_local
package.json
run cd ./node_modules_local
run git clone %path to my fork of babylonjs%
run cd ./@babylonjs
do all staff from guide to contributor until to npm run build in Tools\Gulp (build was succeffuly finished)
go to ./node_modules_local/@babylonjs
run npm link
go to “/my-project”
run npm link "@babylonjs"
and got error
$ npm link "@babylonjs"
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "@babylonjs": Tags may not have any characters that encodeURIComponent encodes.
I did similar actions with other library (fabric.js) and all was fine. I think this actions dont full appyable to scoped packages maybe. Have you idea about?
Dok11
July 16, 2021, 9:46pm
7
Sorry, it was close =)
npm link @babylonjs/core
works fine!
yup and you should not need step 6 and 7 as the build should do it for you