@xh/hoist-dev-utils 12.1.0 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,6 @@ const _ = require('lodash'),
15
15
  CopyWebpackPlugin = require('copy-webpack-plugin'),
16
16
  MiniCssExtractPlugin = require('mini-css-extract-plugin'),
17
17
  HtmlWebpackPlugin = require('html-webpack-plugin'),
18
- HtmlWebpackTagsPlugin = require('html-webpack-tags-plugin'),
19
18
  TerserPlugin = require('terser-webpack-plugin'),
20
19
  WebpackBar = require('webpackbar'),
21
20
  parseChangelogMarkdown = require('changelog-parser'),
@@ -528,7 +527,9 @@ async function configureWebpack(env) {
528
527
  // 3) Production builds use MiniCssExtractPlugin to break built styles into dedicated output files
529
528
  // (vs. tags injected into DOM) for production builds. Note relies on MiniCssExtractPlugin being
530
529
  // called within the prod plugins section.
531
- prodBuild ? MiniCssExtractPlugin.loader : 'style-loader',
530
+ prodBuild
531
+ ? MiniCssExtractPlugin.loader
532
+ : {loader: 'style-loader', options: {esModule: false}},
532
533
 
533
534
  // 2) Resolve @imports within CSS, similar to module support in JS.
534
535
  {
@@ -660,7 +661,10 @@ async function configureWebpack(env) {
660
661
  scriptTags,
661
662
  clientAppName,
662
663
  preloadBackgroundColor,
663
- preloadSpinnerColor
664
+ preloadSpinnerColor,
665
+ // Compilation hash used to cache-bust the (unbundled) preflight script
666
+ // copied in from hoist-react via CopyWebpackPlugin.
667
+ preflightHash: compilation.hash
664
668
  };
665
669
  },
666
670
  // No need to minify the HTML itself
@@ -687,14 +691,6 @@ async function configureWebpack(env) {
687
691
  });
688
692
  }),
689
693
 
690
- // Insert a script tag for the (unbundled) preflight script, before all other scripts.
691
- new HtmlWebpackTagsPlugin({
692
- // Script available at this path via CopyWebpackPlugin above.
693
- scripts: ['public/preflight.js'],
694
- append: false,
695
- hash: true
696
- }),
697
-
698
694
  // Support an optional post-build/run interactive treemap of output bundles and their sizes / contents.
699
695
  analyzeBundles
700
696
  ? new BundleAnalyzerPlugin({
@@ -722,7 +718,7 @@ async function configureWebpack(env) {
722
718
  : {
723
719
  host: devHost,
724
720
  port: devWebpackPort,
725
- hot: false, // Hot module replacement is not currently supported by Hoist, but live reload is.
721
+ hot: true, // Hot module replacement is only supported for SCSS. JS/TS files trigger live reload.
726
722
  client: {overlay: devClientOverlay},
727
723
  server:
728
724
  devHttps === true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist-dev-utils",
3
- "version": "12.1.0",
3
+ "version": "12.2.0",
4
4
  "description": "Utilities for configuring builds of Hoist-React client applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,7 +33,6 @@
33
33
  "css-loader": "~7.1.2",
34
34
  "file-loader": "~6.2.0",
35
35
  "html-webpack-plugin": "~5.6.0",
36
- "html-webpack-tags-plugin": "~3.0.2",
37
36
  "lodash": "4.x",
38
37
  "mini-css-extract-plugin": "~2.10.1",
39
38
  "postcss": "~8.5.3",
@@ -44,7 +43,7 @@
44
43
  "sass-loader": "~16.0.4",
45
44
  "sass-material-colors": "~0.0.5",
46
45
  "style-loader": "~4.0.0",
47
- "terser-webpack-plugin": "~5.5.0",
46
+ "terser-webpack-plugin": "~5.6.0",
48
47
  "type-fest": "5.x",
49
48
  "url-loader": "~4.1.1",
50
49
  "webpack": "~5.106.2",
package/static/index.html CHANGED
@@ -21,6 +21,8 @@
21
21
  </head>
22
22
  <body class="xh-app" style="margin: 0">
23
23
 
24
+ <script src="<%= webpackConfig.output.publicPath %>public/preflight.js?<%= preflightHash %>"></script>
25
+
24
26
  <noscript>
25
27
  This application requires that JavaScript be enabled for this site in your browser.
26
28
  </noscript>