@sumotto/configs 0.0.31 → 0.0.33
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.
- package/helpers/webpack.js +12 -0
- package/package.json +7 -8
- package/wp/tsconfig.json +1 -1
- package/wp/webpack.blocks.config.js +1 -1
- package/wp/webpack.the-builder.config.js +1 -1
- package/wp/webpack.the-modifications.config.js +1 -1
- package/wp/webpack.the-woocommerce.config.js +6 -2
- package/wp/webpack.theme.config.js +1 -1
package/helpers/webpack.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const path = require( 'node:path' );
|
|
2
2
|
const glob = require( 'glob' );
|
|
3
3
|
const fs = require( 'fs' );
|
|
4
|
+
const browserslist = require( 'browserslist' );
|
|
4
5
|
|
|
5
6
|
require( 'dotenv' ).config( {
|
|
6
7
|
path: [
|
|
@@ -15,6 +16,12 @@ require( 'dotenv' ).config( {
|
|
|
15
16
|
],
|
|
16
17
|
} );
|
|
17
18
|
|
|
19
|
+
const browserslistConfig = browserslist.findConfig( process.cwd() );
|
|
20
|
+
if ( ! browserslistConfig ) {
|
|
21
|
+
process.env.BROWSERSLIST =
|
|
22
|
+
'> 0.05% in US and last 3 years, not dead, not UCAndroid > 0, not OperaMini all, not and_qq > 0, not kaios > 0';
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
const [
|
|
19
26
|
defaultConfigWP,
|
|
20
27
|
modulesConfigWP,
|
|
@@ -60,6 +67,11 @@ module.exports.Config = class {
|
|
|
60
67
|
this.entries = {};
|
|
61
68
|
this.entriesFunctions = [];
|
|
62
69
|
|
|
70
|
+
this.config.stats = 'minimal';
|
|
71
|
+
this.config.performance = {
|
|
72
|
+
maxAssetSize: 1048576, // 1MB
|
|
73
|
+
};
|
|
74
|
+
|
|
63
75
|
if ( typeof this.config.entry === 'function' ) {
|
|
64
76
|
this.entriesFunctions.push( this.config.entry );
|
|
65
77
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sumotto/configs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"description": "Configs for my work",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"release": "np --yolo",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/SumoTTo/configs#readme",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"np": "^10.
|
|
23
|
+
"np": "^10.2.0"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"helpers/*",
|
|
@@ -28,17 +28,16 @@
|
|
|
28
28
|
"wp/*"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@wordpress/dependency-extraction-webpack-plugin": "^6.
|
|
32
|
-
"@wordpress/scripts": "^30.
|
|
33
|
-
"chokidar": "^4.0.
|
|
31
|
+
"@wordpress/dependency-extraction-webpack-plugin": "^6.18.0",
|
|
32
|
+
"@wordpress/scripts": "^30.11.0",
|
|
33
|
+
"chokidar": "^4.0.3",
|
|
34
34
|
"copy-webpack-plugin": "^12.0.2",
|
|
35
35
|
"dotenv": "^16.4.7",
|
|
36
36
|
"find-free-port-sync": "^1.0.0",
|
|
37
|
-
"glob": "^11.0.
|
|
38
|
-
"image-minimizer-webpack-plugin": "^4.1.
|
|
37
|
+
"glob": "^11.0.1",
|
|
38
|
+
"image-minimizer-webpack-plugin": "^4.1.3",
|
|
39
39
|
"mini-css-extract-plugin": "^2.9.2",
|
|
40
40
|
"rimraf": "^6.0.1",
|
|
41
|
-
"rtlcss-webpack-plugin": "^4.0.7",
|
|
42
41
|
"svgo": "^3.3.2",
|
|
43
42
|
"sync-directory": "^6.0.5",
|
|
44
43
|
"webpack-remove-empty-scripts": "^1.0.4"
|
package/wp/tsconfig.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const MiniCSSExtractPlugin = require( 'mini-css-extract-plugin' );
|
|
2
|
-
const RtlCssPlugin = require( 'rtlcss-webpack-plugin' );
|
|
2
|
+
const RtlCssPlugin = require( '@wordpress/scripts/plugins/rtlcss-webpack-plugin' );
|
|
3
3
|
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
|
|
4
4
|
const SyncDirectoryWebpackPlugin = require( '../helpers/sync-directory-webpack-plugin' );
|
|
5
5
|
const CleanWebpackPlugin = require( '../helpers/clean-webpack-plugin' );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const MiniCSSExtractPlugin = require( 'mini-css-extract-plugin' );
|
|
2
|
-
const RtlCssPlugin = require( 'rtlcss-webpack-plugin' );
|
|
2
|
+
const RtlCssPlugin = require( '@wordpress/scripts/plugins/rtlcss-webpack-plugin' );
|
|
3
3
|
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
|
|
4
4
|
const SyncWebpackPlugin = require( '../helpers/sync-webpack-plugin' );
|
|
5
5
|
const CleanWebpackPlugin = require( '../helpers/clean-webpack-plugin' );
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );
|
|
2
2
|
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
|
|
3
|
-
const RtlCssPlugin = require( 'rtlcss-webpack-plugin' );
|
|
3
|
+
const RtlCssPlugin = require( '@wordpress/scripts/plugins/rtlcss-webpack-plugin' );
|
|
4
4
|
const CleanWebpackPlugin = require( '../helpers/clean-webpack-plugin' );
|
|
5
5
|
const SyncWebpackPlugin = require( '../helpers/sync-webpack-plugin' );
|
|
6
6
|
const { resolve } = require( 'node:path' );
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
Config,
|
|
9
|
+
defaultConfigWP,
|
|
10
|
+
modulesConfigWP,
|
|
11
|
+
} = require( '../helpers/webpack' );
|
|
8
12
|
const findFreePort = require( 'find-free-port-sync' );
|
|
9
13
|
const rootPath = process.cwd().replace( /\\/g, '/' );
|
|
10
14
|
const outputPath = process.env.WP_CONTENT_DIR
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const CopyWebpackPlugin = require( 'copy-webpack-plugin' );
|
|
2
2
|
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
|
|
3
|
-
const RtlCssPlugin = require( 'rtlcss-webpack-plugin' );
|
|
3
|
+
const RtlCssPlugin = require( '@wordpress/scripts/plugins/rtlcss-webpack-plugin' );
|
|
4
4
|
const ImageMinimizerPlugin = require( 'image-minimizer-webpack-plugin' );
|
|
5
5
|
const SyncWebpackPlugin = require( '../helpers/sync-webpack-plugin' );
|
|
6
6
|
const CleanWebpackPlugin = require( '../helpers/clean-webpack-plugin' );
|