webpack.dev.js

35 lines | 965 B Blame History Raw Download
const path = require('path');
const { merge } = require('webpack-merge');
const copyPlugin = require('copy-webpack-plugin');
const common = require('./webpack.common.js');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');

const devFolderName = "dev-dist";

module.exports = merge(common, {
    mode: 'development',
    output: {
        globalObject: 'self',
		filename: '[name].bundle.js',
        path: path.resolve(__dirname, devFolderName),
        publicPath: "/"
    },
    devServer: {
        static: {
            directory: path.join(__dirname, devFolderName),
        },
        historyApiFallback: true
    },
    plugins: [
        new copyPlugin(
            {
                patterns: [
                    {
                        from: path.resolve(__dirname, 'static'),
                        to: path.resolve(__dirname, devFolderName, '[name][ext]')
                    }
                ]
            }
        )
    ]
});