Working on my first Bubble plugin I successfully managed to create a first working version using the online editor.
Given that the plugin deals with data visualisation most of the work is going to be about defining how html elements are positioned and styled.
I connected my plugin with Github hoping to code and test locally and only synch and test online when testing Bubble integration.
I’m finding it hard to set up a local environment in a way that it doesn’t require too much refactoring or cut/pasting from one js file to another.
Here’s an example:
This is the initialize function in the Bubble editor:
function (instance, context) {
var div;
div = $('<div class="chart"></div>');
instance.canvas.append(div);
}
Once synced through GitHub this is replicated as code within initialize.js

The problem is that it cannot be run as is locally, probably because in Bubble this code is wrapped in an initialize function.
This holds true for other functions as well.
So the question is:
Is there a way to keep the essential local and remote code identical and still be able to test the parts of the app that do not require interaction with Bubble?
Also: are there any potential issues in adding extra js files that are not defined in the editor in the same folder?
Any help appreciated ![]()
