You can create a plugin with the following code:
JavaScript:
require('nw.gui').Window.get().setResizable(false);
Note that this doesn't work with browsers.
If you want it to work with browsers as well, you'll have to rely on a bit of a hack:
JavaScript:
(() => {
const width = window.outerWidth;
const height = window.outerHeight;
window.addEventListener("resize", () => {
window.resizeTo(width, height);
});
})();
Technically, the player can still resize the window, but when they do, the window will automatically be resized to its original size. This is ugly (the player can see the window resizing and reverting), but is the closest I've found to a solution that works in browsers.
To be fair, there's no real reason to disable window resizing on browsers (it's even discouraged). The canvas will have its size set to whatever resolution you defined for your game, and unless you mess with the CSS to have the canvas fill the window, the canvas will always have the same size, no matter how the player resizes the window.
PS: There are no Terms of Use for either of the two plugins above. Use them however you see fit.