arui-scripts 13.1.0-feature-yarn2.1 → 13.1.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [13.1.1](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.1.0...v13.1.1) (2022-08-05)
2
+
3
+
4
+ ### Performance Improvements
5
+
6
+ * **webpack-dev:** add caching ([ed76817](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/ed7681710130e6d0716114b11c5b698a15eb4b45))
7
+
8
+ # [13.1.0](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.0.0...v13.1.0) (2022-08-05)
9
+
10
+
11
+ ### Features
12
+
13
+ * add yarn 2 support ([5d4bb8c](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/5d4bb8c5e4debb3d0db430c094effbedd9b7bcc3))
14
+
1
15
  # [13.1.0-feature-yarn2.1](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.0.0...v13.1.0-feature-yarn2.1) (2022-08-04)
2
16
 
3
17
 
package/README.md CHANGED
@@ -451,6 +451,20 @@ require node.js на таких местах ломается. Поэтому н
451
451
  воспользоваться механизмом `overrides`, описанным ниже.
452
452
  По умолчанию же все не-js файлы из внешних модулей будут проигнорированы.
453
453
 
454
+ Кеширование билда
455
+ ---
456
+ В dev сборке для сервера и клиента настроено кеширование. Оно должно нормально работать когда вы просто работаете
457
+ над проектом - меняете ваш код, ставите новые зависимости и тд.
458
+
459
+ Но когда вы руками меняете код внутри node_modules - вы не сможете увидеть ваши изменения, так как webpack будет
460
+ использовать данные из кеша. Для того чтобы ваши изменения применились в сборке вам необходимо очистить кеш
461
+ webpack и перезапустить сборку. Кеши хранятся в папке `.cache` внутри `node_modules` вашего проекта.
462
+
463
+ ```
464
+ rm -rf ./node_modules/.cache
465
+ ```
466
+
467
+
454
468
  Анализ бандла
455
469
  ---
456
470
  Для изучения итогового бандла приложения и просмотра его размеров и включенных файлов в arui-scripts есть команда
@@ -9,11 +9,9 @@ const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sens
9
9
  const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
10
10
  const assets_webpack_plugin_1 = __importDefault(require("assets-webpack-plugin"));
11
11
  const tsconfig_paths_webpack_plugin_1 = __importDefault(require("tsconfig-paths-webpack-plugin"));
12
- const WatchMissingNodeModulesPlugin_1 = __importDefault(require("react-dev-utils/WatchMissingNodeModulesPlugin"));
13
12
  const getCSSModuleLocalIdent_1 = __importDefault(require("react-dev-utils/getCSSModuleLocalIdent"));
14
13
  const PnpWebpackPlugin = require('pnp-webpack-plugin');
15
14
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
16
- const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
17
15
  const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
18
16
  const ReactRefreshTypeScript = require('react-refresh-typescript');
19
17
  const app_configs_1 = __importDefault(require("./app-configs"));
@@ -81,6 +79,12 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
81
79
  PnpWebpackPlugin.moduleLoader(module),
82
80
  ],
83
81
  },
82
+ cache: {
83
+ type: 'filesystem',
84
+ buildDependencies: {
85
+ config: [__filename],
86
+ },
87
+ },
84
88
  module: {
85
89
  // typescript interface will be removed from modules, and we will get an error on correct code
86
90
  // see https://github.com/webpack/webpack/issues/7378
@@ -138,6 +142,7 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
138
142
  // It enables caching results in ./node_modules/.cache/babel-loader/
139
143
  // directory for faster rebuilds.
140
144
  cacheDirectory: true,
145
+ cacheCompression: false,
141
146
  plugins: require.resolve('react-refresh/babel')
142
147
  }, babel_client_1.default)
143
148
  },
@@ -254,17 +259,6 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
254
259
  // a plugin that prints an error when you attempt to do this.
255
260
  // See https://github.com/facebookincubator/create-react-app/issues/240
256
261
  new case_sensitive_paths_webpack_plugin_1.default(),
257
- // If you require a missing module and then `npm install` it, you still have
258
- // to restart the development server for Webpack to discover it. This plugin
259
- // makes the discovery automatic so you don't have to restart.
260
- // See https://github.com/facebookincubator/create-react-app/issues/186
261
- new WatchMissingNodeModulesPlugin_1.default(app_configs_1.default.appNodeModules),
262
- // new CopyWebpackPlugin([
263
- // {
264
- // from: configs.staticFilesLocation,
265
- // to: configs.clientOutputPath
266
- // }
267
- // ])
268
262
  app_configs_1.default.tsconfig !== null && new fork_ts_checker_webpack_plugin_1.default(),
269
263
  new MiniCssExtractPlugin(),
270
264
  ].filter(Boolean)),
@@ -275,34 +269,16 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
275
269
  hints: false,
276
270
  },
277
271
  optimization: {
278
- minimize: true,
272
+ minimize: false,
279
273
  nodeEnv: false,
280
- minimizer: [
281
- new CssMinimizerPlugin({
282
- minimizerOptions: {
283
- processorOptions: {
284
- map: {
285
- // `inline: false` generates the source map in a separate file.
286
- // Otherwise, the CSS file is needlessly large.
287
- inline: false,
288
- // `annotation: false` skips appending the `sourceMappingURL`
289
- // to the end of the CSS file. Webpack already handles this.
290
- annotation: false,
291
- },
292
- },
293
- preset: () => ({
294
- plugins: [
295
- // eslint-disable-next-line global-require
296
- require('postcss-discard-duplicates'),
297
- ],
298
- }),
299
- },
300
- }),
301
- ],
274
+ // Оптимизации времени билда, см https://webpack.js.org/guides/build-performance/
275
+ removeAvailableModules: false,
276
+ removeEmptyChunks: false,
277
+ splitChunks: false
302
278
  },
303
279
  // Без этого комиляция трирегилась на изменение в node_modules и приводила к утечке памяти
304
280
  watchOptions: {
305
- ignored: '**/node_modules',
281
+ ignored: /node_modules/,
306
282
  }
307
283
  });
308
284
  exports.default = webpackClientDev;
@@ -53,6 +53,13 @@ const config = {
53
53
  .relative(app_configs_1.default.appSrc, info.absoluteResourcePath)
54
54
  .replace(/\\/g, '/'),
55
55
  },
56
+ cache: {
57
+ type: 'filesystem',
58
+ name: 'server',
59
+ buildDependencies: {
60
+ config: [__filename],
61
+ },
62
+ },
56
63
  externalsPresets: { node: true },
57
64
  externals: [webpack_node_externals_1.default({
58
65
  allowlist: [
@@ -217,6 +224,9 @@ const config = {
217
224
  performance: {
218
225
  hints: false,
219
226
  },
227
+ watchOptions: {
228
+ ignored: /node_modules/,
229
+ }
220
230
  };
221
231
  const webpackServerDev = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], config);
222
232
  exports.default = webpackServerDev;
@@ -1311,13 +1311,8 @@
1311
1311
  "signature": "a36125690b0197836e27f150c6848c40aeca31d692b7b3f58ac2fb9d9fce28b5",
1312
1312
  "affectsGlobalScope": false
1313
1313
  },
1314
- "../../../.yarn/cache/@types-react-dev-utils-npm-9.0.8-14221814bb-d7b6cdc89a.zip/node_modules/@types/react-dev-utils/WatchMissingNodeModulesPlugin.d.ts": {
1315
- "version": "c4ecf6cf29e03d5b9947d634f72561d87a6c16e0081933b759f9eb97c81c305a",
1316
- "signature": "c4ecf6cf29e03d5b9947d634f72561d87a6c16e0081933b759f9eb97c81c305a",
1317
- "affectsGlobalScope": false
1318
- },
1319
1314
  "../src/configs/webpack.client.dev.ts": {
1320
- "version": "b0faf6fe2b3727ce933e8f061febf434270230d6a0e329b851373b9c6053ce7f",
1315
+ "version": "ab613f3f0228e6654c545b4e0976ce30a7ff265ef978a70452e64ef253d71928",
1321
1316
  "signature": "bf4cb593d7c7ac6097823d647f70fdf078e1b8175693cf9e24537625e3e69fa0",
1322
1317
  "affectsGlobalScope": false
1323
1318
  },
@@ -1341,8 +1336,13 @@
1341
1336
  "signature": "735d19ae41bbcd78b654d84c5bbd2474472cc20b5299aaeabb0b096cdd05a59d",
1342
1337
  "affectsGlobalScope": false
1343
1338
  },
1339
+ "../../../.yarn/cache/@types-react-dev-utils-npm-9.0.8-14221814bb-d7b6cdc89a.zip/node_modules/@types/react-dev-utils/WatchMissingNodeModulesPlugin.d.ts": {
1340
+ "version": "c4ecf6cf29e03d5b9947d634f72561d87a6c16e0081933b759f9eb97c81c305a",
1341
+ "signature": "c4ecf6cf29e03d5b9947d634f72561d87a6c16e0081933b759f9eb97c81c305a",
1342
+ "affectsGlobalScope": false
1343
+ },
1344
1344
  "../src/configs/webpack.server.dev.ts": {
1345
- "version": "0597234884dd74415bee23d36364cc4151225e8d0dae8bfd7de6f026733e1aec",
1345
+ "version": "bac57268e464424a7c9ac90ea88623edf45792a6cc2ca60ca8e8966fbe03e2e3",
1346
1346
  "signature": "4289eb8081c31f5b009209c36c04417fd4a0f39c5740422650d076d059d0a5d3",
1347
1347
  "affectsGlobalScope": false
1348
1348
  },
@@ -5568,7 +5568,6 @@
5568
5568
  "../../../.yarn/cache/@types-node-npm-12.12.58-b4a5c5f701-2e86ae45c7.zip/node_modules/@types/node/ts3.1/util.d.ts",
5569
5569
  "../../../.yarn/cache/@types-node-npm-12.12.58-b4a5c5f701-2e86ae45c7.zip/node_modules/@types/node/ts3.3/fs.d.ts",
5570
5570
  "../../../.yarn/cache/@types-node-npm-12.12.58-b4a5c5f701-2e86ae45c7.zip/node_modules/@types/node/ts3.3/util.d.ts",
5571
- "../../../.yarn/cache/@types-react-dev-utils-npm-9.0.8-14221814bb-d7b6cdc89a.zip/node_modules/@types/react-dev-utils/WatchMissingNodeModulesPlugin.d.ts",
5572
5571
  "../../../.yarn/cache/@types-react-dev-utils-npm-9.0.8-14221814bb-d7b6cdc89a.zip/node_modules/@types/react-dev-utils/getCSSModuleLocalIdent.d.ts",
5573
5572
  "../../../.yarn/cache/tsconfig-paths-webpack-plugin-npm-3.5.1-f1a5ca3b27-86a58fc9ab.zip/node_modules/tsconfig-paths-webpack-plugin/lib/index.d.ts",
5574
5573
  "../src/configs/app-configs/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "13.1.0-feature-yarn2.1",
3
+ "version": "13.1.1",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "license": "MPL-2.0",