statping/frontend/config/webpack.config.dev.js

50 lines
1.1 KiB
JavaScript

'use strict';
const webpack = require('webpack');
const merge = require('webpack-merge');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const helpers = require('./helpers');
const commonConfig = require('./webpack.config.common');
const environment = require('./dev.env');
const webpackConfig = merge(commonConfig, {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
output: {
path: helpers.root('dist'),
publicPath: '/',
filename: 'js/[name].bundle.js',
chunkFilename: 'js/[id].chunk.js'
},
optimization: {
runtimeChunk: 'single',
splitChunks: {
chunks: 'all'
}
},
plugins: [
new webpack.EnvironmentPlugin(environment),
new webpack.HotModuleReplacementPlugin(),
new FriendlyErrorsPlugin()
],
devServer: {
compress: true,
historyApiFallback: true,
hot: true,
open: true,
overlay: true,
port: 8888,
stats: {
normal: true
},
proxy: {
'/api': {
logLevel: 'debug',
target: 'http://0.0.0.0:8585'
}
}
}
});
module.exports = webpackConfig;