Graphql server hitting the 1mb script limit

Im using webpack (production mode)
Total Upload: 8875.87 KiB / gzip: 1016.18 KiB

text: ‘Script startup timed out. This could be due to script exceeding size limits or
expensive code in the global scope.\n’ +
’ [code: 10021]’

Im not sure what else i can and my script size will only grow in result of adding more code

Is this normal?

Im also using node-stdlib-browser via npm to add node polyfills.

heres my webpack.config.js

const stdLibBrowser = require('node-stdlib-browser');
const {
    NodeProtocolUrlPlugin
} = require('node-stdlib-browser/helpers/webpack/plugin');
const path = require('path')

module.exports = {
    entry: './src/index.ts',
    target: 'webworker',
    output: {
        filename: 'worker.js',
        path: path.join(__dirname, 'dist'),
    },
    devtool: 'source-map',
    mode: 'production',
    optimization: {
        minimize: true
    },
    resolve: {
        extensions: ['.ts', '.tsx', '.js'],
        alias: {
            ...stdLibBrowser,
            '~': path.resolve(__dirname, 'src')
        },
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                loader: 'ts-loader',
                exclude: /node_modules/,
                options: {
                    transpileOnly: true,
                },
            },
            // { enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' },
        ],
    },
    optimization: {
        usedExports: true,
    },
    plugins: [
        new NodeProtocolUrlPlugin(),
        new webpack.ProvidePlugin({
            process: stdLibBrowser.process,
            Buffer: [stdLibBrowser.buffer, 'Buffer']
        }),
        new BundleAnalyzerPlugin()
    ]
}