mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-29 05:19:03 -05:00
Changes to allow active development of UI using webpack and hotloading. (#22)
* Changes to allow active development of UI using webpack and hotloading. * Update to webpack 4 (will make this work) * Update webpack.config.js accordingly * Move webpack.config.js to its own directory * Split webpack.config.js into base.config.js, dev.config.js and prod.config.js * Update configs to be "right" for development vs production using --mode * Want configuration through (optional) local file that is not checked in * Updated package.json for newer babel-loader * Put in a proxy to localhost port 8080 for evelopment server. This allows "yarn start" to work on the machine where MoonFire's server is running. This would be the default situation. Users in a different setup can change the proxy settings.
This commit is contained in:
committed by
Scott Lamb
parent
e4cc8d6c0f
commit
a03b98631a
26
webpack/dev.config.js
Normal file
26
webpack/dev.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const merge = require('webpack-merge');
|
||||
|
||||
const baseConfig = require('./base.config.js');
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
devtool: 'inline-source-map',
|
||||
devServer: {
|
||||
contentBase: './ui-src',
|
||||
historyApiFallback: true,
|
||||
inline: true,
|
||||
port: 3000,
|
||||
hot: true,
|
||||
clientLogLevel: 'info',
|
||||
proxy: {
|
||||
'/api': 'http://localhost:8080'
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify('development'),
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user