Can't open new browserwindow in build version



I’m building an electron application that works like this:
The main browserwindow has node integration set to false and has a preload script that gives access to a couple of things. One of those things is the ability to spawn a new browser window with the same configuration, like:

//part of preload.js
GlobalVariable = {
  open: url => {
		const win = new BrowserWindow({
				nodeIntegration: false,
				preload: path.join(__dirname, 'preload.js')

		var webContents = win.webContents;

		if(url[url.length-1] !== '/') url += '/'

This works perfect while developing (running via node-electron). But when build (using electron-packager) it fails to open new browser windows.

Since I’m pretty new to Electron I wanted to check here if there’s something I need to know about this before reporting a bug…

Is there a way to still have the debug tools in a build version?