Webpack setup & required node packages.
This commit is contained in:
49
config/webpack.config.dev.js
Normal file
49
config/webpack.config.dev.js
Normal file
@@ -0,0 +1,49 @@
|
||||
const webpack = require("webpack");
|
||||
const FriendlyErrorsPlugin = require("friendly-errors-webpack-plugin");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const helpers = require("./helpers");
|
||||
// const environment = require("./env/dev.env");
|
||||
const MiniCSSExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
let webpackConfig = {
|
||||
mode: "development",
|
||||
devtool: "eval-cheap-module-source-map",
|
||||
output: {
|
||||
publicPath: "/",
|
||||
filename: "js/[name].bundle.js"
|
||||
},
|
||||
optimization: {
|
||||
concatenateModules: true,
|
||||
splitChunks: {
|
||||
chunks: "initial"
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new FriendlyErrorsPlugin(),
|
||||
new MiniCSSExtractPlugin({
|
||||
filename: "css/[name].css"
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: "frontend/templates/Index.html"
|
||||
})
|
||||
],
|
||||
devServer: {
|
||||
compress: true,
|
||||
historyApiFallback: true,
|
||||
host: "0.0.0.0",
|
||||
hot: true,
|
||||
overlay: true,
|
||||
stats: {
|
||||
normal: true
|
||||
},
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://localhost:30010",
|
||||
changeOrigin: false
|
||||
}
|
||||
},
|
||||
writeToDisk: false
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = webpackConfig;
|
||||
Reference in New Issue
Block a user