webpack.dev.js
Home
/
webpack.dev.js
const path = require('path');
const { merge } = require('webpack-merge');
const copyPlugin = 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: {
static: {
directory: path.join(__dirname, devFolderName),
},
historyApiFallback: true
},
plugins: [
new copyPlugin(
{
patterns: [
{
from: path.resolve(__dirname, 'index.html'),
to: path.resolve(__dirname, devFolderName, '[name][ext]')
}
]
}
)
]
});