Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

[Feature Request] melonJS lib as npm dependency #26

Closed
route1rodent opened this issue Jun 9, 2017 · 5 comments
Closed

[Feature Request] melonJS lib as npm dependency #26

route1rodent opened this issue Jun 9, 2017 · 5 comments

Comments

@route1rodent
Copy link

route1rodent commented Jun 9, 2017

I would like to avoid including the melonJS library source code directly in my project repositories and I think that the proper way to do that would be to require MelonJS and MelonJS plugins as npm dependencies in the package.json, but as far as I know there is no official npm package for MelonJS / MelonJS plugins, right? You may need to register them I guess.

melonjs and melonjs-plugins names are available in the npm registry.

For the Gruntfile.js and the index.html I would just reference the js files from node_modules instead of lib.

What do you think?

@parasyte
Copy link
Collaborator

parasyte commented Jun 9, 2017

Unfortunately the biggest problem with using npm with our current melonJS source code is that melonJS isn't modular at the moment. It needs to be built into one giant concatenated file.

Our build process tries (tried? what happened to it?) address this by building the giant files and committing them off-branch with tags. The idea is that a package manager like npm or bower can fetch the commit which contains the pre-built files. I think it's not currently working this way, though.

I agree, it would be a much cleaner implementation. The build infrastructure just needs a little work to get there.

@route1rodent
Copy link
Author

I think it would work out of the box if the package.json of MelonJS has a build script (check jQuery example)

That script is called everytime the package is installed, so the main file specified here will be there once the package is installed.

Even if it's not modular yet, I think it's better than nothing :)

@route1rodent
Copy link
Author

route1rodent commented Mar 14, 2018

I see you are making MelonJS modular in v.6.0.0 melonjs/melonJS#915
that's good news :) looking forward 😍

@obiot
Copy link
Member

obiot commented Mar 14, 2018

yes ! but "converting" the whole source code it's a long and tedious task to be honest :)

@obiot
Copy link
Member

obiot commented Jul 9, 2020

done a while ago now, but the boilerplate will now use the latest melonJS version out of jsDeliver:
https://www.jsdelivr.com/package/npm/melonjs

but if you need/prefer NPM it's also properly available there since version 7.0 :
https://www.npmjs.com/package/melonjs

@obiot obiot closed this as completed Jul 9, 2020
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