Chore: Setup live reloading (#97248)

* setup live reloading

* put live-reloading behind cli flag, remove webpack.hot.js

* use env.liveReload

* fix lint

---------

Co-authored-by: joshhunt <josh@trtr.co>
This commit is contained in:
Dominik Broj
2024-12-02 13:58:50 +01:00
committed by GitHub
parent 219411f894
commit cfbeea4ce7
4 changed files with 139 additions and 105 deletions

View File

@ -8,6 +8,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const { DefinePlugin, EnvironmentPlugin } = require('webpack');
const WebpackAssetsManifest = require('webpack-assets-manifest');
const LiveReloadPlugin = require('webpack-livereload-plugin');
const { merge } = require('webpack-merge');
const WebpackBar = require('webpackbar');
@ -105,6 +106,17 @@ module.exports = (env = {}) => {
},
plugins: [
...(parseInt(env.liveReload, 10)
? [
new LiveReloadPlugin({
appendScriptTag: true,
useSourceHash: true,
hostname: 'localhost',
protocol: 'http',
port: 35750,
}),
]
: []),
parseInt(env.noTsCheck, 10)
? new DefinePlugin({}) // bogus plugin to satisfy webpack API
: new ForkTsCheckerWebpackPlugin({