63 lines
1.9 KiB
JavaScript
63 lines
1.9 KiB
JavaScript
// Development config
|
|
const merge = require("webpack-merge");
|
|
const webpack = require("webpack");
|
|
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
|
|
|
|
const commonConfig = require("./common.js");
|
|
|
|
module.exports = merge(commonConfig, {
|
|
mode: "development",
|
|
entry: [
|
|
"react-hot-loader/patch", // Activate HMR for React
|
|
"webpack-dev-server/client?http://0.0.0.0:8080", // Bundle the client for webpack-dev-server and connect to the provided endpoint
|
|
"webpack/hot/only-dev-server", // Bundle the client for hot reloading, only- means to only hot reload for successful updates
|
|
"./index.tsx" // The entry point of our app
|
|
],
|
|
devServer: {
|
|
hot: true, // Enable HMR on the server
|
|
historyApiFallback: true,
|
|
host: '0.0.0.0',
|
|
port: '8080',
|
|
allowedHosts: [
|
|
'.sik.party',
|
|
'.sahkoinsinoorikilta.fi',
|
|
],
|
|
proxy: {
|
|
'/api': 'http://localhost:8000',
|
|
},
|
|
// clientLogLevel: 'none',
|
|
// https: settings.dev_server.https,
|
|
// host: settings.dev_server.host,
|
|
// port: settings.dev_server.port,
|
|
// contentBase: output.path,
|
|
// public: settings.dev_server.public,
|
|
// publicPath: output.publicPath,
|
|
// compress: true,
|
|
// headers: { 'Access-Control-Allow-Origin': '*' },
|
|
// historyApiFallback: true,
|
|
// watchOptions: {
|
|
// ignored: /node_modules/
|
|
// }
|
|
},
|
|
devtool: "cheap-module-eval-source-map",
|
|
plugins: [
|
|
new FaviconsWebpackPlugin({
|
|
logo: "./assets/img/favicon.png",
|
|
icons: {
|
|
android: false,
|
|
appleIcon: false,
|
|
appleStartup: false,
|
|
coast: false,
|
|
favicons: true,
|
|
firefox: false,
|
|
opengraph: false,
|
|
twitter: false,
|
|
yandex: false,
|
|
windows: false
|
|
}
|
|
}),
|
|
new webpack.HotModuleReplacementPlugin(), // Enable HMR globally
|
|
new webpack.NamedModulesPlugin() // Prints more readable module names in the browser console on HMR updates
|
|
]
|
|
});
|