@gravity-ui/app-builder 0.5.4 → 0.5.6

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,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.6](https://github.com/gravity-ui/app-builder/compare/v0.5.5...v0.5.6) (2023-07-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * add webpack cache option ([#47](https://github.com/gravity-ui/app-builder/issues/47)) ([fb5311a](https://github.com/gravity-ui/app-builder/commit/fb5311a5635dfc95051434fdeb878b4c34c457c2))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * make statoscope config fields optional ([#45](https://github.com/gravity-ui/app-builder/issues/45)) ([1e80938](https://github.com/gravity-ui/app-builder/commit/1e809384b3af358ed4837d57c28928a291e99a4e))
14
+
15
+ ## [0.5.5](https://github.com/gravity-ui/app-builder/compare/v0.5.4...v0.5.5) (2023-07-07)
16
+
17
+
18
+ ### Features
19
+
20
+ * statoscope can be configured ([#42](https://github.com/gravity-ui/app-builder/issues/42)) ([9a21979](https://github.com/gravity-ui/app-builder/commit/9a219798ad416811dfd6d448c9dfa4e330e0659c))
21
+
3
22
  ## [0.5.4](https://github.com/gravity-ui/app-builder/compare/v0.5.3...v0.5.4) (2023-07-06)
4
23
 
5
24
 
package/README.md CHANGED
@@ -188,6 +188,8 @@ With this `{rootDir}/src/ui/tsconfig.json`:
188
188
  - `entryFilter` (`string[]`) — filter used entrypoints.
189
189
  - `excludeFromClean` (`string[]`) — do not clean provided paths before build.
190
190
  - `forkTsCheker` (`false | ForkTsCheckerWebpackPluginOptions`) - config for ForkTsCheckerWebpackPlugin [more](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#options). If `false`, ForkTsCheckerWebpackPlugin will be disabled.
191
+ - `cache` (`boolean | FileCacheOptions | MemoryCacheOptions`) — Cache the generated webpack modules and chunks to improve build speed. [more](https://webpack.js.org/configuration/cache/)
192
+ - `babelCacheDirectory` (`boolean | string`) — Set directory for babel-loader cache (`default: node_modules/.cache/babel-loader``)
191
193
 
192
194
  ##### Dev build
193
195
 
@@ -213,6 +215,7 @@ With this `{rootDir}/src/ui/tsconfig.json`:
213
215
  - `true` — enable [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) plugin. Report generated to `dist/public/build/stats.html`
214
216
  - `statoscope` — enable [statoscope](https://github.com/statoscope/statoscope) plugin. Reports generated to `dist/public/build/stats.json` and `dist/public/build/report.json`
215
217
  - `reactProfiling` (`boolean`) — use react profiler API in production, this option also disable minimization. The API is required by React developers tools for profile.
218
+ - `statoscopeConfig` (`Options`) — `@statoscope/webpack-plugin` [configuration options](https://github.com/statoscope/statoscope/tree/master/packages/webpack-plugin#usage). Might be used to override the defaults. Requires `analyzeBundle: statoscope`.
216
219
  - `cdn` (`CdnUploadConfig | CdnUploadConfig[]`) - upload bundled client files to CDN.
217
220
  - `bucket` (`string`) — bucket name
218
221
  - `prefix` (`string`) — path to files inside the bucket
@@ -2,11 +2,12 @@ import type { EditorLanguage } from 'monaco-editor-webpack-plugin/out/languages'
2
2
  import type { EditorFeature } from 'monaco-editor-webpack-plugin/out/features';
3
3
  import type { IFeatureDefinition } from 'monaco-editor-webpack-plugin/out/types';
4
4
  import type { Options as MomentTzOptions } from 'moment-timezone-data-webpack-plugin';
5
- import type { Configuration, ResolveOptions, DefinePlugin } from 'webpack';
5
+ import type { Configuration, ResolveOptions, DefinePlugin, FileCacheOptions, MemoryCacheOptions } from 'webpack';
6
6
  import type { ServerConfiguration } from 'webpack-dev-server';
7
7
  import type { Options as CircularDependenciesOptions } from 'circular-dependency-plugin';
8
8
  import type { Config as SvgrConfig } from '@svgr/core';
9
9
  import type { ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin/lib/plugin-options';
10
+ import type { Options as StatoscopeOptions } from '@statoscope/webpack-plugin';
10
11
  export interface Entities<T> {
11
12
  data: Record<string, T>;
12
13
  keys: string[];
@@ -125,6 +126,7 @@ export interface ClientConfig {
125
126
  entryFilter?: string[];
126
127
  excludeFromClean?: string[];
127
128
  analyzeBundle?: 'true' | 'statoscope';
129
+ statoscopeConfig?: Partial<StatoscopeOptions>;
128
130
  reactProfiling?: boolean;
129
131
  /**
130
132
  * Disable react-refresh in dev mode
@@ -163,6 +165,8 @@ export interface ClientConfig {
163
165
  * use webpack 5 Web Workers [syntax](https://webpack.js.org/guides/web-workers/#syntax)
164
166
  */
165
167
  newWebWorkerSyntax?: boolean;
168
+ babelCacheDirectory?: boolean | string;
169
+ cache?: boolean | FileCacheOptions | MemoryCacheOptions;
166
170
  }
167
171
  interface CdnUploadConfig {
168
172
  bucket: string;
@@ -91,6 +91,7 @@ function webpackConfigFactory(webpackMode, config, { logger } = {}) {
91
91
  snapshot: {
92
92
  managedPaths: config.watchOptions?.watchPackages ? [] : undefined,
93
93
  },
94
+ cache: config.cache,
94
95
  };
95
96
  }
96
97
  exports.webpackConfigFactory = webpackConfigFactory;
@@ -274,7 +275,7 @@ function createJavaScriptLoader({ isEnvProduction, isEnvDevelopment, config, })
274
275
  isEnvProduction && require.resolve('babel-plugin-lodash'),
275
276
  ].filter(Boolean),
276
277
  sourceType: 'unambiguous',
277
- cacheDirectory: true,
278
+ cacheDirectory: config.babelCacheDirectory ? config.babelCacheDirectory : true,
278
279
  cacheCompression: isEnvProduction,
279
280
  compact: isEnvProduction,
280
281
  sourceMap: !config.disableSourceMapGeneration,
@@ -626,6 +627,7 @@ function configurePlugins(options) {
626
627
  }));
627
628
  }
628
629
  if (config.analyzeBundle === 'statoscope') {
630
+ const customStatoscopeConfig = config.statoscopeConfig || {};
629
631
  plugins.push(new webpack_plugin_1.default({
630
632
  saveReportTo: path_1.default.resolve(paths_1.default.appBuild, 'report.html'),
631
633
  saveStatsTo: path_1.default.resolve(paths_1.default.appBuild, 'stats.json'),
@@ -633,6 +635,7 @@ function configurePlugins(options) {
633
635
  statsOptions: {
634
636
  all: true,
635
637
  },
638
+ ...customStatoscopeConfig,
636
639
  }));
637
640
  }
638
641
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/app-builder",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Develop and build your React client-server projects, powered by typescript and webpack",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",