Answer the question
In order to leave comments, you need to log in
How to include js library in Electron.js?
good afternoon!
I'm writing an Electron.js app and want to use my own js library built with Browserify.
I include the library in index.html as a regular script in HEAD and try to use it in javascript
var Converter = require('./libs/cadXML2GeoJSON.js');
<script>window.Converter = require('./libs/cadXML2GeoJSON.js');</script>
Answer the question
In order to leave comments, you need to log in
Firstly, electron does not need browserify, it even holds common-js modules without it
Secondly, the plug-in must write something to module.exports so that it would be available from the outside
Dmitry, the library lives by itself without knowing about Electron.
The link shows that the library exports (module.exports.GeoJSON = function (xmlData, reproject) {.....)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question