Open heretic13 opened 6 years ago
Solution is simple:
comment this: / else if (typeof module === 'object' && typeof module.exports === 'object') { // Node/CommonJS L = require('leaflet'); module.exports = factory(L); } /
Please anybody make a pull request.
Some advices from me to community:
Hi.
I create some applications with Electron. Now I have a problem with "Leaflet.contextmenu". I'ts not working. I began investigating and found a bug place:
(function(factory) { // Packaging/modules magic dance var L; if (typeof define === 'function' && define.amd) { // AMD define(['leaflet'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { // Node/CommonJS L = require('leaflet'); module.exports = factory(L); } else { // Browser globals if (typeof window.L === 'undefined') { throw new Error('Leaflet must be loaded first'); } factory(window.L); } })
The fact is that Electron supports the require method on web pages(since it is based on Node.js). But this does not mean that it is necessary to load the leaflet module.
Here I see two nuances:
I do not know the right decision.