"use strict";

const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")

module.exports = {
    entry: ['./truffle-debugger-worker.ts'],
    mode: 'production',
    target: 'web',
    module: {
        rules: [
            {
                test: /\.ts$/,
                use: 'ts-loader',
                exclude: /node_modules/
            },
        ]
    },
    plugins: [
		new NodePolyfillPlugin()
	],
    resolve: {
        extensions: ['.ts', '.js'],
        fallback: {
            'fs': false
        }
    },
    output: {
        globalObject: 'this', 
        path: __dirname + "/dist",
        filename: 'truffle-debugger-worker.js',
        libraryTarget: 'umd',
    }
};