Selection Box Issue with Webpack Bundler

I have some code that is working well on my unbundled vite app and I am now in the process of using webpack and making a bundled file to serve up to a remote server.

The problem comes in with selection box functionality (three.js webgl - box selection), it works fine on the unbundled file, but upon bundling, it is not working.

Select box working on unbundled file:

Recording 2025-03-12 at 21.56.55

Select box not working on bundled file:

Recording 2025-03-12 at 21.54.33

This is my import statement for selectBox and selectionhelper

import { SelectionBox } from 'three/examples/jsm/interactive/SelectionBox.js';
import { SelectionHelper } from 'three/examples/jsm/interactive/SelectionHelper.js';

Any ideas on what is going wrong? Other three.js functionality is working as intended.

This is my webpack.config.cjs file contents if helpful.

module.exports = {
    mode: "production",
    entry: "./src/main.js", // Main entry point
    output: {
        filename: "concgui.bundle.js",
        path: path.resolve(__dirname, "public/static/concgui"),
        clean: true,
    },

I just played with switching the mode from “production” to “development” and the bundled file actually works now.

mode: "development", //mode: "production",

Any ideas on why the “production” file does not work?