webpack.dev.js

27 lines | 724 B Blame History Raw Download
const path = require('path');
const merge = require('webpack-merge');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const common = require('./webpack.common.js');

const devFolderName = "dev-dist";

module.exports = merge(common, {
    mode: 'development',
    output: {
        path: path.resolve(__dirname, devFolderName),
        publicPath: "/",
        filename: 'main.js'
    },
    devServer: {
        contentBase: './' + devFolderName,
        historyApiFallback: true
    },
    plugins: [
        new CopyWebpackPlugin([
            {
                from: path.resolve(__dirname, '*.html'),
                to: path.resolve(__dirname, devFolderName, '[name].[ext]')
            }
        ])
    ]
});