@lipemat/js-boilerplate 9.2.0 → 10.0.0-beta.2

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.
@@ -19,11 +19,13 @@ module.exports = {
19
19
  cacheDirectory: true,
20
20
  presets: [
21
21
  [ '@babel/preset-env', presetEnv ],
22
- '@babel/preset-react',
22
+ [ '@babel/preset-react', {
23
+ development: 'production' !== process.env.NODE_ENV,
24
+ runtime: 'automatic',
25
+ } ],
23
26
  '@babel/preset-typescript',
24
27
  ],
25
28
  plugins: [
26
29
  '@babel/plugin-syntax-dynamic-import',
27
- 'react-hot-loader/babel',
28
30
  ],
29
31
  };
@@ -1,9 +1,10 @@
1
- const {getConfig, hasLocalOverride} = require( '../helpers/config' );
2
1
  const webpack = require( 'webpack' );
2
+ const ReactRefreshWebpackPlugin = require( '@pmmmwh/react-refresh-webpack-plugin' );
3
3
  const path = require( 'path' );
4
4
  const ForkTsCheckerWebpackPlugin = require( 'fork-ts-checker-webpack-plugin' );
5
5
  const config = require( '../helpers/package-config' );
6
6
  const {getEntries} = require( '../helpers/entries' );
7
+ const {getConfig, hasLocalOverride} = require( '../helpers/config' );
7
8
 
8
9
  const postcssOptions = getConfig( 'postcss.config.js' );
9
10
  const babelOptions = getConfig( 'babel.config.js' );
@@ -12,12 +13,15 @@ const devServerOptions = getConfig( 'dev-server.config.js' );
12
13
 
13
14
  // To allow line numbers to show up in console errors. @see React Error Boundaries.
14
15
  babelOptions.plugins.unshift( '@babel/plugin-transform-react-jsx-source' );
16
+ // To support React Fast Refresh.
17
+ babelOptions.plugins.unshift( 'react-refresh/babel' );
15
18
 
16
19
  const plugins = [
17
20
  new webpack.ProvidePlugin( {
18
21
  jQuery: 'jquery',
19
22
  $: 'jquery',
20
23
  } ),
24
+ new ReactRefreshWebpackPlugin(),
21
25
  ];
22
26
 
23
27
  // Loads a thread, which verifies any TypeScripts on changes.
@@ -47,9 +51,6 @@ module.exports = {
47
51
  chunkFilename: '[name].js',
48
52
  },
49
53
  resolve: {
50
- alias: {
51
- 'react-dom': '@hot-loader/react-dom',
52
- },
53
54
  extensions: [ '.ts', '.tsx', '.js', '.jsx', '.json', '.pcss' ],
54
55
  modules: [
55
56
  path.resolve( config.workingDirectory, 'src' ),
@@ -73,7 +74,6 @@ module.exports = {
73
74
  {
74
75
  test: /\.[jt]sx?$/,
75
76
  include: /node_modules/,
76
- use: [ 'react-hot-loader/webpack' ],
77
77
  },
78
78
  {
79
79
  test: /\.css$/,
package/helpers/config.js CHANGED
@@ -3,7 +3,10 @@ const path = require( 'path' );
3
3
  const once = require( 'lodash/once' );
4
4
  const browserslist = require( 'browserslist' );
5
5
 
6
- const extensions = Object.keys( packageConfig.dependencies ).filter( name => name.includes( 'js-boilerplate-' ) );
6
+ const extensions = [
7
+ ...Object.keys( packageConfig.dependencies ?? {} ).filter( name => name.includes( 'js-boilerplate-' ) ),
8
+ ...Object.keys( packageConfig.devDependencies ?? {} ).filter( name => name.includes( 'js-boilerplate-' ) ),
9
+ ];
7
10
 
8
11
  /**
9
12
  * Check to see if a local config file exists.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lipemat/js-boilerplate",
3
- "version": "9.2.0",
3
+ "version": "10.0.0-beta.2",
4
4
  "description": "Dependencies and scripts for a no config JavaScript app",
5
5
  "author": "Mat Lipe",
6
6
  "license": "MIT",
@@ -42,10 +42,10 @@
42
42
  "@babel/preset-env": "^7.12.11",
43
43
  "@babel/preset-react": "^7.12.10",
44
44
  "@babel/preset-typescript": "^7.12.7",
45
- "@hot-loader/react-dom": "^17.0.1",
46
45
  "@lipemat/css-mqpacker": "^9.0.0",
47
46
  "@lipemat/eslint-config": "^2.0.1",
48
- "@types/lipemat__js-boilerplate": "lipemat/types-js-boilerplate#semver:^1.3.0",
47
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
48
+ "@types/lipemat__js-boilerplate": "lipemat/types-js-boilerplate#semver:^2",
49
49
  "@wordpress/browserslist-config": "^4.1.0",
50
50
  "are-you-es5": "^2.1.1",
51
51
  "babel-jest": "^29.0.0",
@@ -72,9 +72,9 @@
72
72
  "postcss-nested": "^5.0.6",
73
73
  "postcss-preset-env": "^7.5.0",
74
74
  "postcss-scss": "^4.0.4",
75
- "react": "^17.0.1",
76
- "react-dom": "^17.0.1",
77
- "react-hot-loader": "^4.8.3",
75
+ "react": "^18.2.0",
76
+ "react-dom": "^18.2.0",
77
+ "react-refresh": "^0.14.0",
78
78
  "style-loader": "^3.3.1",
79
79
  "typescript": "^4.2.4",
80
80
  "update-notifier": "^4.1.3",
@@ -84,5 +84,5 @@
84
84
  "webpack-dev-server": "^4.7.2",
85
85
  "webpack-subresource-integrity": "^5.1.0"
86
86
  },
87
- "packageManager": "yarn@3.2.3"
87
+ "packageManager": "yarn@3.5.0"
88
88
  }