@modern-js/uni-builder 0.0.0-nightly-20231219170633 → 2.43.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.
@@ -1,8 +1,8 @@
1
1
  import type { RsbuildConfig, RsbuildPlugin, RsbuildInstance } from '@rsbuild/core';
2
2
  import type { RsbuildProvider, StartServerResult } from '@rsbuild/shared';
3
- import type { UniBuilderRspackConfig, CreateRspackBuilderOptions, CreateBuilderCommonOptions } from '../types';
3
+ import type { BuilderConfig, CreateUniBuilderOptions, CreateBuilderCommonOptions } from '../types';
4
4
  import type { StartDevServerOptions } from '../shared/devServer';
5
- export declare function parseConfig(uniBuilderConfig: UniBuilderRspackConfig, options: CreateBuilderCommonOptions): Promise<{
5
+ export declare function parseConfig(uniBuilderConfig: BuilderConfig, options: CreateBuilderCommonOptions): Promise<{
6
6
  rsbuildConfig: RsbuildConfig;
7
7
  rsbuildPlugins: RsbuildPlugin[];
8
8
  }>;
@@ -14,5 +14,5 @@ type UniBuilderInstance = Omit<RsbuildInstance<RsbuildProvider>, 'startDevServer
14
14
  */
15
15
  startDevServer: (options: StartDevServerOptions) => Promise<StartServerResult>;
16
16
  };
17
- export declare function createRspackBuilder(options: CreateRspackBuilderOptions): Promise<UniBuilderInstance>;
17
+ export declare function createRspackBuilder(options: CreateUniBuilderOptions): Promise<UniBuilderInstance>;
18
18
  export {};
@@ -1,8 +1,8 @@
1
1
  import { type RsbuildPlugin, type RsbuildConfig } from '@rsbuild/core';
2
- import type { CreateBuilderCommonOptions, UniBuilderRspackConfig, UniBuilderWebpackConfig } from '../types';
2
+ import type { CreateBuilderCommonOptions, BuilderConfig } from '../types';
3
3
  /** Determine if a file path is a CSS module when disableCssModuleExtension is enabled. */
4
4
  export declare const isLooseCssModules: (path: string) => boolean;
5
- export declare function parseCommonConfig<B = 'rspack' | 'webpack'>(uniBuilderConfig: B extends 'rspack' ? UniBuilderRspackConfig : UniBuilderWebpackConfig, options: CreateBuilderCommonOptions): Promise<{
5
+ export declare function parseCommonConfig(uniBuilderConfig: BuilderConfig, options: CreateBuilderCommonOptions): Promise<{
6
6
  rsbuildConfig: RsbuildConfig;
7
7
  rsbuildPlugins: RsbuildPlugin[];
8
8
  }>;
package/dist/types.d.ts CHANGED
@@ -16,17 +16,12 @@ export type CreateBuilderCommonOptions = {
16
16
  frameworkConfigPath?: string;
17
17
  target?: RsbuildTarget | RsbuildTarget[];
18
18
  /** The root path of current project. */
19
- cwd?: string;
19
+ cwd: string;
20
20
  };
21
- export type CreateWebpackBuilderOptions = {
22
- bundlerType: 'webpack';
23
- config: UniBuilderWebpackConfig;
24
- } & CreateBuilderCommonOptions;
25
- export type CreateRspackBuilderOptions = {
26
- bundlerType: 'rspack';
27
- config: UniBuilderRspackConfig;
28
- } & CreateBuilderCommonOptions;
29
- export type CreateUniBuilderOptions = CreateWebpackBuilderOptions | CreateRspackBuilderOptions;
21
+ export type CreateUniBuilderOptions = {
22
+ bundlerType: 'rspack' | 'webpack';
23
+ config: BuilderConfig;
24
+ } & Partial<CreateBuilderCommonOptions>;
30
25
  export type GlobalVars = Record<string, any>;
31
26
  export type ChainedGlobalVars = ChainedConfigWithUtils<GlobalVars, {
32
27
  env: NodeEnv;
@@ -79,6 +74,13 @@ export type UniBuilderExtraConfig = {
79
74
  * Note that `Object.assign` is a shallow copy and will completely overwrite the built-in `presets` or `plugins` array, please use it with caution.
80
75
  */
81
76
  babel?: PluginBabelOptions['babelLoaderOptions'];
77
+ /**
78
+ * Modify the options of [ts-loader](https://github.com/TypeStrong/ts-loader).
79
+ * When `tools.tsLoader` is not undefined, Rsbuild will use ts-loader instead of babel-loader to compile TypeScript code.
80
+ *
81
+ * Tips: this configuration is not yet supported in rspack
82
+ */
83
+ tsLoader?: PluginTsLoaderOptions;
82
84
  };
83
85
  dev?: {
84
86
  /**
@@ -205,12 +207,23 @@ export type UniBuilderExtraConfig = {
205
207
  templateParametersByEntries?: Record<string, Record<string, unknown>>;
206
208
  };
207
209
  security?: {
210
+ /**
211
+ * Adding an integrity attribute (`integrity`) to sub-resources introduced by HTML allows the browser to
212
+ * verify the integrity of the introduced resource, thus preventing tampering with the downloaded resource.
213
+ *
214
+ * Tips: this configuration is not yet supported in rspack
215
+ */
216
+ sri?: SriOptions | boolean;
208
217
  /**
209
218
  * Analyze the build artifacts to identify advanced syntax that is incompatible with the current browser scope.
210
219
  */
211
220
  checkSyntax?: boolean | PluginCheckSyntaxOptions;
212
221
  };
213
222
  experiments?: {
223
+ /**
224
+ * Tips: this configuration is not yet supported in rspack
225
+ */
226
+ lazyCompilation?: LazyCompilationOptions;
214
227
  /**
215
228
  * Enable the ability for source code building
216
229
  */
@@ -222,24 +235,4 @@ export type SriOptions = {
222
235
  enabled?: 'auto' | true | false;
223
236
  hashLoading?: 'eager' | 'lazy';
224
237
  };
225
- export type UniBuilderWebpackConfig = RsbuildConfig & UniBuilderExtraConfig & {
226
- security?: {
227
- /**
228
- * Adding an integrity attribute (`integrity`) to sub-resources introduced by HTML allows the browser to
229
- * verify the integrity of the introduced resource, thus preventing tampering with the downloaded resource.
230
- */
231
- sri?: SriOptions | boolean;
232
- };
233
- experiments?: {
234
- lazyCompilation?: LazyCompilationOptions;
235
- };
236
- tools?: {
237
- /**
238
- * Modify the options of [ts-loader](https://github.com/TypeStrong/ts-loader).
239
- * When `tools.tsLoader` is not undefined, Rsbuild will use ts-loader instead of babel-loader to compile TypeScript code.
240
- */
241
- tsLoader?: PluginTsLoaderOptions;
242
- };
243
- };
244
- export type UniBuilderRspackConfig = RsbuildConfig & UniBuilderExtraConfig;
245
- export type BuilderConfig<B = 'rspack'> = B extends 'rspack' ? UniBuilderRspackConfig : UniBuilderWebpackConfig;
238
+ export type BuilderConfig = RsbuildConfig & UniBuilderExtraConfig;
@@ -1,13 +1,13 @@
1
1
  import { type RsbuildConfig, type RsbuildPlugin, type RsbuildInstance } from '@rsbuild/core';
2
2
  import type { StartServerResult } from '@rsbuild/shared';
3
- import type { UniBuilderWebpackConfig, CreateWebpackBuilderOptions, CreateBuilderCommonOptions } from '../types';
3
+ import type { BuilderConfig, CreateUniBuilderOptions, CreateBuilderCommonOptions } from '../types';
4
4
  import type { StartDevServerOptions } from '../shared/devServer';
5
- export declare function parseConfig(uniBuilderConfig: UniBuilderWebpackConfig, options: CreateBuilderCommonOptions): Promise<{
5
+ export declare function parseConfig(uniBuilderConfig: BuilderConfig, options: CreateBuilderCommonOptions): Promise<{
6
6
  rsbuildConfig: RsbuildConfig;
7
7
  rsbuildPlugins: RsbuildPlugin[];
8
8
  }>;
9
9
  type UniBuilderWebpackInstance = Omit<RsbuildInstance, 'startDevServer'> & {
10
10
  startDevServer: (options: StartDevServerOptions) => Promise<StartServerResult>;
11
11
  };
12
- export declare function createWebpackBuilder(options: CreateWebpackBuilderOptions): Promise<UniBuilderWebpackInstance>;
12
+ export declare function createWebpackBuilder(options: CreateUniBuilderOptions): Promise<UniBuilderWebpackInstance>;
13
13
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/uni-builder",
3
- "version": "0.0.0-nightly-20231219170633",
3
+ "version": "2.43.0",
4
4
  "description": "Unified builder for Modern.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,21 +25,21 @@
25
25
  "@babel/preset-react": "^7.22.15",
26
26
  "@babel/types": "^7.23.0",
27
27
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
28
- "@rsbuild/babel-preset": "0.2.4",
29
- "@rsbuild/core": "0.2.4",
30
- "@rsbuild/plugin-assets-retry": "0.2.4",
31
- "@rsbuild/plugin-babel": "0.2.4",
32
- "@rsbuild/plugin-check-syntax": "0.2.4",
33
- "@rsbuild/plugin-css-minimizer": "0.2.4",
34
- "@rsbuild/plugin-pug": "0.2.4",
35
- "@rsbuild/plugin-react": "0.2.4",
36
- "@rsbuild/plugin-rem": "0.2.4",
37
- "@rsbuild/plugin-source-build": "0.2.4",
38
- "@rsbuild/plugin-styled-components": "0.2.4",
39
- "@rsbuild/plugin-svgr": "0.2.4",
40
- "@rsbuild/plugin-type-check": "0.2.4",
41
- "@rsbuild/shared": "0.2.4",
42
- "@rsbuild/webpack": "0.2.4",
28
+ "@rsbuild/babel-preset": "0.2.7",
29
+ "@rsbuild/core": "0.2.7",
30
+ "@rsbuild/plugin-assets-retry": "0.2.7",
31
+ "@rsbuild/plugin-babel": "0.2.7",
32
+ "@rsbuild/plugin-check-syntax": "0.2.7",
33
+ "@rsbuild/plugin-css-minimizer": "0.2.7",
34
+ "@rsbuild/plugin-pug": "0.2.7",
35
+ "@rsbuild/plugin-react": "0.2.7",
36
+ "@rsbuild/plugin-rem": "0.2.7",
37
+ "@rsbuild/plugin-source-build": "0.2.7",
38
+ "@rsbuild/plugin-styled-components": "0.2.7",
39
+ "@rsbuild/plugin-svgr": "0.2.7",
40
+ "@rsbuild/plugin-type-check": "0.2.7",
41
+ "@rsbuild/shared": "0.2.7",
42
+ "@rsbuild/webpack": "0.2.7",
43
43
  "@swc/helpers": "0.5.3",
44
44
  "babel-loader": "9.1.3",
45
45
  "babel-plugin-import": "1.13.5",
@@ -60,18 +60,18 @@
60
60
  "webpack": "^5.89.0",
61
61
  "webpack-manifest-plugin": "5.0.0",
62
62
  "webpack-subresource-integrity": "5.1.0",
63
- "@modern-js/server": "0.0.0-nightly-20231219170633",
64
- "@modern-js/utils": "0.0.0-nightly-20231219170633",
65
- "@modern-js/prod-server": "0.0.0-nightly-20231219170633"
63
+ "@modern-js/server": "2.43.0",
64
+ "@modern-js/utils": "2.43.0",
65
+ "@modern-js/prod-server": "2.43.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@rsbuild/plugin-swc": "0.2.4",
68
+ "@rsbuild/plugin-swc": "0.2.7",
69
69
  "@types/lodash": "^4.14.202",
70
70
  "react": "^18.2.0",
71
71
  "react-dom": "^18.2.0",
72
72
  "typescript": "^5.3.0",
73
- "@scripts/vitest-config": "0.0.0-nightly-20231219170633",
74
- "@scripts/build": "0.0.0-nightly-20231219170633"
73
+ "@scripts/vitest-config": "2.43.0",
74
+ "@scripts/build": "2.43.0"
75
75
  },
76
76
  "publishConfig": {
77
77
  "access": "public",