@flatjs/evolve 1.8.1-next.96 → 1.8.1-next.99

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @flatjs/evolve
2
2
 
3
+ ## 1.8.1-next.99
4
+
5
+ ### Patch Changes
6
+
7
+ - d131622: update HMR message
8
+
9
+ ## 1.8.1-next.98
10
+
11
+ ### Patch Changes
12
+
13
+ - 8700943: refactor `liveReload` config
14
+
15
+ ## 1.8.1-next.97
16
+
17
+ ### Patch Changes
18
+
19
+ - 5754203: Add `liveReload` options of devserver to allow forced reload
20
+
3
21
  ## 1.8.1-next.96
4
22
 
5
23
  ### Patch Changes
@@ -1 +1 @@
1
- import{logger}from"@flatjs/common";import ReactRefreshWebpackPlugin from"@pmmmwh/react-refresh-webpack-plugin";import CaseSensitivePathsPlugin from"case-sensitive-paths-webpack-plugin";import ForkTsCheckerWebpackPlugin from"fork-ts-checker-webpack-plugin";import MiniCssExtractPlugin from"mini-css-extract-plugin";import webpack from"webpack";import{BundleAnalyzerPlugin}from"webpack-bundle-analyzer";import{enableBundleHashNameForModule}from"../helpers/enable-bundle-hashname-for-module.js";import{getBundleFileName}from"../helpers/get-bundle-file-name.js";import{shouldEnableReactFastRefresh}from"../helpers/should-enable-react-fast-refresh.js";import{createCircularDependencyPlugin}from"../plugins/circular-dependency/index.js";import{createCleanWebpackPlugin}from"../plugins/clean-webpack/index.js";import{createBuiltinDefineVariables}from"../plugins/define-variable/index.js";import{createModuleFederationPlugin}from"../plugins/module-federation/index.js";import{createHtmlPlugins}from"../plugins/multi-html/index.js";export const createPlugins=async(e,n,a)=>{const[r,i]=n,l=enableBundleHashNameForModule(a,i?.options),t=[new webpack.WatchIgnorePlugin({paths:[/\.d\.[cm]ts$/]}),new CaseSensitivePathsPlugin,...createCircularDependencyPlugin(e,a),new MiniCssExtractPlugin({filename:`[name]/${getBundleFileName("css",e,l)}`,chunkFilename:"[id].[contenthash].css"}),...await createBuiltinDefineVariables(e,a),...createCleanWebpackPlugin(e,n,a),...createModuleFederationPlugin(e,n,a),...createHtmlPlugins(e,n,a)],{analyzer:s,loaderOptions:o}=a,c=(n[1].entry||[]).find((e=>/.vue$/.test(e)));o.runTsChecker&&!c&&t.push(new ForkTsCheckerWebpackPlugin({async:e,typescript:{context:a.projectCwd,memoryLimit:8192}})),s&&t.push(new BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...s}));const u=shouldEnableReactFastRefresh(e,n,a);u&&t.push(new ReactRefreshWebpackPlugin({overlay:!1})),!u&&e&&logger.warn(`The HMR has disabled cause of \`"${r}":"moduleFederation"\``);const p=a.webpack?.plugins||[];return t.concat(p)};
1
+ import{logger}from"@flatjs/common";import ReactRefreshWebpackPlugin from"@pmmmwh/react-refresh-webpack-plugin";import CaseSensitivePathsPlugin from"case-sensitive-paths-webpack-plugin";import ForkTsCheckerWebpackPlugin from"fork-ts-checker-webpack-plugin";import MiniCssExtractPlugin from"mini-css-extract-plugin";import webpack from"webpack";import{BundleAnalyzerPlugin}from"webpack-bundle-analyzer";import{enableBundleHashNameForModule}from"../helpers/enable-bundle-hashname-for-module.js";import{getBundleFileName}from"../helpers/get-bundle-file-name.js";import{shouldEnableReactFastRefresh}from"../helpers/should-enable-react-fast-refresh.js";import{createCircularDependencyPlugin}from"../plugins/circular-dependency/index.js";import{createCleanWebpackPlugin}from"../plugins/clean-webpack/index.js";import{createBuiltinDefineVariables}from"../plugins/define-variable/index.js";import{createModuleFederationPlugin}from"../plugins/module-federation/index.js";import{createHtmlPlugins}from"../plugins/multi-html/index.js";export const createPlugins=async(e,n,a)=>{const[r,i]=n,l=enableBundleHashNameForModule(a,i?.options),t=[new webpack.WatchIgnorePlugin({paths:[/\.d\.[cm]ts$/]}),new CaseSensitivePathsPlugin,...createCircularDependencyPlugin(e,a),new MiniCssExtractPlugin({filename:`[name]/${getBundleFileName("css",e,l)}`,chunkFilename:"[id].[contenthash].css"}),...await createBuiltinDefineVariables(e,a),...createCleanWebpackPlugin(e,n,a),...createModuleFederationPlugin(e,n,a),...createHtmlPlugins(e,n,a)],{analyzer:s,loaderOptions:o}=a,c=(n[1].entry||[]).find((e=>/.vue$/.test(e)));o.runTsChecker&&!c&&t.push(new ForkTsCheckerWebpackPlugin({async:e,typescript:{context:a.projectCwd,memoryLimit:8192}})),s&&t.push(new BundleAnalyzerPlugin({analyzerPort:"auto",analyzerMode:"server",...s}));const u=shouldEnableReactFastRefresh(e,n,a);u&&t.push(new ReactRefreshWebpackPlugin({overlay:!1})),!u&&e&&(a.devServer?.liveReload?logger.warn('The HMR disabled cause of "liveReload" specificed'):logger.warn(`The HMR disabled cause of \`"moduleFederation":"${r}"\``));const p=a.webpack?.plugins||[];return t.concat(p)};
@@ -1 +1 @@
1
- export const shouldEnableReactFastRefresh=(e,t,o)=>{const s=t[1],n=!!s.options?.moduleFederation;return e&&"react"===o.loaderOptions.babelOptions?.usePreset&&!n};
1
+ export const shouldEnableReactFastRefresh=(e,o,t)=>{const r=o[1],s=!!r.options?.moduleFederation;return e&&"react"===t.loaderOptions.babelOptions?.usePreset&&!s&&!0!==t.devServer?.liveReload};
@@ -41,6 +41,11 @@ export type FlatEvolveDevServerOptions = {
41
41
  * @default true
42
42
  */
43
43
  autoOpen?: boolean;
44
+ /**
45
+ * Enables reload/refresh the page(s) when file changes are detected (`auto` by default).
46
+ * @default undefined
47
+ */
48
+ liveReload?: true;
44
49
  /**
45
50
  * Enables a full-screen overlay in the browser when there are compiler errors or warnings.
46
51
  * @default {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "1.8.1-next.96",
3
+ "version": "1.8.1-next.99",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {