obiot Posted April 2, 2019 Share Posted April 2, 2019 For those who have not noticed yet, since with version 7.0.0, melonJS is now officially available through NPM, it means as well that the latest build of melonJS can now install through NPM or/and available through the jsdeliver CDN. for NPM : $ npm install melonjs For delivery through jsdelivr content delivery network (CDN) URL : <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/melonjs.js"></script> or the following for the minified version : <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/melonjs.min.js"></script> and of course the debug panel : <script src="https://cdn.jsdelivr.net/npm/[email protected]/plugins/debug/debugPanel.js"></script> Note: "official" CDN and NPM install are only available from version 7.0.0 and onwards. Quote Link to comment Share on other sites More sharing options...
IvanKochetkov Posted November 1, 2020 Share Posted November 1, 2020 If i use npm way for melonjs, how i can use it in my electron js app? when i try like this (in my preload.js file): window.addEventListener('DOMContentLoaded', () => { window.melonjs = require('melonjs') } its not work for me ( and editor say: cant find module definitions for node_modules/melonjs/dist/melonjs.js" Quote Link to comment Share on other sites More sharing options...
obiot Posted November 3, 2020 Author Share Posted November 3, 2020 I'm not sure why you do like this, why don't you just include melonJS in your package.json ? this is will install it with other dependencies, and then the call to require should work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.