const path = require('path');

module.exports = {
    entry: './src/index.ts',
    output: {
        path: path.resolve(__dirname + '/dist'),
        filename: 'index.js',
        library: 'ReactWhiteboard',
        libraryTarget: 'umd'
    },
    module: {
        rules: [{
            test: /\.tsx?$/,
            exclude: /node_modules/,
            use: {
                loader: 'ts-loader'
            }
        }]
    },
    resolve: {
        extensions: [ '.tsx', '.ts', '.js' ]
    },
    externals: {
        'react': 'react',
        'react-dom': 'react-dom'
    },
    mode: process.env.WEBPACK_SERVE ? 'development' : 'production',
    devtool: 'source-map'
};

const path = require('path');

module.exports = {
    entry: './src/index.ts',
    output: {
        path: path.resolve(__dirname + '/dist'),
        filename: 'index.js',
        library: 'ReactWhiteboard',
        libraryTarget: 'umd'
    },
    module: {
        rules: [{
            test: /\.tsx?$/,
            exclude: /node_modules/,
            use: {
                loader: 'ts-loader'
            }
        }]
    },
    resolve: {
        extensions: [ '.tsx', '.ts', '.js' ]
    },
    externals: {
        'react': 'react',
        'react-dom': 'react-dom'
    },
    mode: 'production',
    devtool: 'source-map'
};

Set webpack mode to production always
Set webpack mode to production always
