@lipemat/js-boilerplate 9.2.0-beta.8 → 9.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.
@@ -5,25 +5,30 @@ const {getLocalIdent} = require( '../helpers/css-classnames' );
5
5
  * Options for the Webpack `css-loader`.
6
6
  *
7
7
  * Extracted to its on file to allow easy overrides.
8
+ */
9
+
10
+ /**
11
+ * Default to :global for classes in "global" or "pcss" directories.
8
12
  *
9
- * @since 8.6.0
13
+ * @param {string} resourcePath
14
+ * @return {string}
10
15
  */
16
+ const mode = resourcePath => {
17
+ if ( /globals?\//i.test( resourcePath.replace( /\\/g, '/' ) ) ) {
18
+ return 'global';
19
+ }
20
+ if ( /pcss?\//i.test( resourcePath.replace( /\\/g, '/' ) ) ) {
21
+ return 'global';
22
+ }
23
+ return 'local';
24
+ };
11
25
 
12
26
  let cssLoader = {
13
27
  importLoaders: 1,
14
28
  modules: {
15
29
  exportLocalsConvention: 'camelCase',
16
30
  localIdentName: 'Ⓜ[name]__[local]__[contenthash:base64:2]',
17
- // Default to :global for classes in "global" or "pcss" directories.
18
- mode: resourcePath => {
19
- if ( /globals?\//i.test( resourcePath.replace( /\\/g, '/' ) ) ) {
20
- return 'global';
21
- }
22
- if ( /pcss?\//i.test( resourcePath.replace( /\\/g, '/' ) ) ) {
23
- return 'global';
24
- }
25
- return 'local';
26
- },
31
+ mode,
27
32
  },
28
33
  sourceMap: true,
29
34
  url: false,
@@ -38,10 +43,7 @@ if ( 'production' === process.env.NODE_ENV ) {
38
43
  ...config.shortCssClasses ? {getLocalIdent} : {},
39
44
  // Hash used when short CSS classes are not enabled.
40
45
  localIdentName: '[contenthash:base64:5]',
41
- // Default to :global for classes in "global" directories.
42
- mode: resourcePath => {
43
- return /globals?\//i.test( resourcePath.replace( /\\/g, '/' ) ) ? 'global' : 'local';
44
- },
46
+ mode,
45
47
  },
46
48
  url: false,
47
49
  };
@@ -1,6 +1,5 @@
1
1
  const webpack = require( 'webpack' );
2
2
  const path = require( 'path' );
3
- require( 'node:crypto' );
4
3
  const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' );
5
4
  const {CleanWebpackPlugin} = require( 'clean-webpack-plugin' );
6
5
  const WebpackAssetsManifest = require( 'webpack-assets-manifest' );
@@ -119,7 +118,6 @@ module.exports = {
119
118
  },
120
119
  ],
121
120
  },
122
-
123
121
  ],
124
122
  },
125
123
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lipemat/js-boilerplate",
3
- "version": "9.2.0-beta.8",
3
+ "version": "9.2.0",
4
4
  "description": "Dependencies and scripts for a no config JavaScript app",
5
5
  "author": "Mat Lipe",
6
6
  "license": "MIT",
@@ -45,7 +45,6 @@
45
45
  "@hot-loader/react-dom": "^17.0.1",
46
46
  "@lipemat/css-mqpacker": "^9.0.0",
47
47
  "@lipemat/eslint-config": "^2.0.1",
48
- "@lipemat/webpack-cleanup-plugin": "^1.0.0",
49
48
  "@types/lipemat__js-boilerplate": "lipemat/types-js-boilerplate#semver:^1.3.0",
50
49
  "@wordpress/browserslist-config": "^4.1.0",
51
50
  "are-you-es5": "^2.1.1",
@@ -58,7 +57,7 @@
58
57
  "cross-spawn": "^6.0.5",
59
58
  "css-loader": "6.7.1",
60
59
  "fork-ts-checker-webpack-plugin": "^7.2.13",
61
- "html-webpack-plugin": "^4.5.0",
60
+ "html-webpack-plugin": "^5.5.0",
62
61
  "identity-obj-proxy": "^3.0.0",
63
62
  "jest": "^29.0.0",
64
63
  "jest-cli": "^29.0.0",