@rsbuild/core 1.1.0 → 1.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/compiled/css-loader/index.js +46 -46
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/http-proxy-middleware/index.d.ts +4 -3
- package/compiled/postcss/index.js +120 -114
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-load-config/index.js +10 -10
- package/compiled/postcss-loader/index.js +11 -11
- package/compiled/rsbuild-dev-middleware/index.js +64 -101
- package/compiled/rsbuild-dev-middleware/package.json +1 -1
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/client/hmr.js +195 -213
- package/dist/client/overlay.js +88 -90
- package/dist/ignoreCssLoader.cjs +65 -29
- package/dist/index.cjs +11029 -13676
- package/dist/index.js +10685 -13616
- package/dist/transformLoader.cjs +77 -51
- package/dist/transformRawLoader.cjs +105 -60
- package/dist-types/config.d.ts +1 -1
- package/dist-types/configChain.d.ts +1 -1
- package/dist-types/helpers/index.d.ts +3 -1
- package/dist-types/logger.d.ts +1 -1
- package/dist-types/plugins/lazyCompilation.d.ts +1 -1
- package/dist-types/provider/createCompiler.d.ts +1 -1
- package/dist-types/server/compilerDevMiddleware.d.ts +4 -3
- package/dist-types/server/devServer.d.ts +1 -1
- package/dist-types/server/helper.d.ts +1 -0
- package/dist-types/server/httpServer.d.ts +1 -1
- package/dist-types/server/middlewares.d.ts +2 -2
- package/dist-types/server/prodServer.d.ts +1 -1
- package/dist-types/types/config.d.ts +7 -7
- package/dist-types/types/hooks.d.ts +1 -1
- package/dist-types/types/plugin.d.ts +2 -2
- package/dist-types/types/rspack.d.ts +1 -1
- package/dist-types/types/thirdParty.d.ts +1 -1
- package/package.json +11 -10
package/dist/transformLoader.cjs
CHANGED
|
@@ -1,55 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
// The require scope
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
/************************************************************************/ // webpack/runtime/define_property_getters
|
|
5
|
+
(()=>{
|
|
6
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
7
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: definition[key]
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
// webpack/runtime/has_own_property
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.o = function(obj, prop) {
|
|
16
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
// webpack/runtime/make_namespace_object
|
|
20
|
+
(()=>{
|
|
21
|
+
// define __esModule on exports
|
|
22
|
+
__webpack_require__.r = function(exports1) {
|
|
23
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
24
|
+
value: 'Module'
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
27
|
+
value: true
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
})();
|
|
31
|
+
/************************************************************************/ var __webpack_exports__ = {};
|
|
32
|
+
__webpack_require__.r(__webpack_exports__);
|
|
33
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
34
|
+
default: function() {
|
|
35
|
+
return transform;
|
|
36
|
+
}
|
|
24
37
|
});
|
|
25
|
-
module.exports = __toCommonJS(transformLoader_exports);
|
|
26
38
|
async function transform(source, map) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return bypass();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
if (typeof result === "string") {
|
|
50
|
-
return callback(null, result, map);
|
|
51
|
-
}
|
|
52
|
-
const useMap = map !== void 0 && map !== null;
|
|
53
|
-
const finalMap = result.map ?? map;
|
|
54
|
-
callback(null, result.code, useMap ? finalMap : void 0);
|
|
39
|
+
var _this__compiler___rsbuildTransformer, _this__compiler;
|
|
40
|
+
const callback = this.async();
|
|
41
|
+
const bypass = ()=>callback(null, source, map);
|
|
42
|
+
const { id: transformId, getEnvironment } = this.getOptions();
|
|
43
|
+
if (!transformId) return bypass();
|
|
44
|
+
const transform = null === (_this__compiler = this._compiler) || void 0 === _this__compiler ? void 0 : null === (_this__compiler___rsbuildTransformer = _this__compiler.__rsbuildTransformer) || void 0 === _this__compiler___rsbuildTransformer ? void 0 : _this__compiler___rsbuildTransformer[transformId];
|
|
45
|
+
if (!transform) return bypass();
|
|
46
|
+
const result = await transform({
|
|
47
|
+
code: source,
|
|
48
|
+
resource: this.resource,
|
|
49
|
+
resourcePath: this.resourcePath,
|
|
50
|
+
resourceQuery: this.resourceQuery,
|
|
51
|
+
environment: getEnvironment(),
|
|
52
|
+
addDependency: this.addDependency,
|
|
53
|
+
emitFile: this.emitFile
|
|
54
|
+
});
|
|
55
|
+
if (null == result) return bypass();
|
|
56
|
+
if ('string' == typeof result) return callback(null, result, map);
|
|
57
|
+
const useMap = null != map;
|
|
58
|
+
const finalMap = result.map ?? map;
|
|
59
|
+
callback(null, result.code, useMap ? finalMap : void 0);
|
|
55
60
|
}
|
|
61
|
+
var __webpack_export_target__ = exports;
|
|
62
|
+
for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];
|
|
63
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
64
|
+
value: true
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
PLUGIN_CSS_NAME,
|
|
70
|
+
PLUGIN_SWC_NAME,
|
|
71
|
+
__internalHelper,
|
|
72
|
+
createRsbuild,
|
|
73
|
+
defineConfig,
|
|
74
|
+
ensureAssetPrefix,
|
|
75
|
+
loadConfig,
|
|
76
|
+
loadEnv,
|
|
77
|
+
logger,
|
|
78
|
+
mergeRsbuildConfig,
|
|
79
|
+
rspack,
|
|
80
|
+
version
|
|
81
|
+
});
|
|
@@ -1,66 +1,111 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./src/loader/transformLoader.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
5
|
+
default: function() {
|
|
6
|
+
return transform;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
async function transform(source, map) {
|
|
10
|
+
var _this__compiler___rsbuildTransformer, _this__compiler;
|
|
11
|
+
const callback = this.async();
|
|
12
|
+
const bypass = ()=>callback(null, source, map);
|
|
13
|
+
const { id: transformId, getEnvironment } = this.getOptions();
|
|
14
|
+
if (!transformId) return bypass();
|
|
15
|
+
const transform = null === (_this__compiler = this._compiler) || void 0 === _this__compiler ? void 0 : null === (_this__compiler___rsbuildTransformer = _this__compiler.__rsbuildTransformer) || void 0 === _this__compiler___rsbuildTransformer ? void 0 : _this__compiler___rsbuildTransformer[transformId];
|
|
16
|
+
if (!transform) return bypass();
|
|
17
|
+
const result = await transform({
|
|
18
|
+
code: source,
|
|
19
|
+
resource: this.resource,
|
|
20
|
+
resourcePath: this.resourcePath,
|
|
21
|
+
resourceQuery: this.resourceQuery,
|
|
22
|
+
environment: getEnvironment(),
|
|
23
|
+
addDependency: this.addDependency,
|
|
24
|
+
emitFile: this.emitFile
|
|
25
|
+
});
|
|
26
|
+
if (null == result) return bypass();
|
|
27
|
+
if ('string' == typeof result) return callback(null, result, map);
|
|
28
|
+
const useMap = null != map;
|
|
29
|
+
const finalMap = result.map ?? map;
|
|
30
|
+
callback(null, result.code, useMap ? finalMap : void 0);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
9
33
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(transformRawLoader_exports);
|
|
27
|
-
|
|
28
|
-
// src/loader/transformLoader.ts
|
|
29
|
-
async function transform(source, map) {
|
|
30
|
-
const callback = this.async();
|
|
31
|
-
const bypass = () => callback(null, source, map);
|
|
32
|
-
const { id: transformId, getEnvironment } = this.getOptions();
|
|
33
|
-
if (!transformId) {
|
|
34
|
-
return bypass();
|
|
35
|
-
}
|
|
36
|
-
const transform2 = this._compiler?.__rsbuildTransformer?.[transformId];
|
|
37
|
-
if (!transform2) {
|
|
38
|
-
return bypass();
|
|
39
|
-
}
|
|
40
|
-
const result = await transform2({
|
|
41
|
-
code: source,
|
|
42
|
-
resource: this.resource,
|
|
43
|
-
resourcePath: this.resourcePath,
|
|
44
|
-
resourceQuery: this.resourceQuery,
|
|
45
|
-
environment: getEnvironment(),
|
|
46
|
-
addDependency: this.addDependency,
|
|
47
|
-
emitFile: this.emitFile
|
|
48
|
-
});
|
|
49
|
-
if (result === null || result === void 0) {
|
|
50
|
-
return bypass();
|
|
51
|
-
}
|
|
52
|
-
if (typeof result === "string") {
|
|
53
|
-
return callback(null, result, map);
|
|
54
|
-
}
|
|
55
|
-
const useMap = map !== void 0 && map !== null;
|
|
56
|
-
const finalMap = result.map ?? map;
|
|
57
|
-
callback(null, result.code, useMap ? finalMap : void 0);
|
|
34
|
+
/************************************************************************/ // The module cache
|
|
35
|
+
var __webpack_module_cache__ = {};
|
|
36
|
+
// The require function
|
|
37
|
+
function __webpack_require__(moduleId) {
|
|
38
|
+
// Check if module is in cache
|
|
39
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
40
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
41
|
+
// Create a new module (and put it into the cache)
|
|
42
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
43
|
+
exports: {}
|
|
44
|
+
};
|
|
45
|
+
// Execute the module function
|
|
46
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
47
|
+
// Return the exports of the module
|
|
48
|
+
return module.exports;
|
|
58
49
|
}
|
|
50
|
+
/************************************************************************/ // webpack/runtime/define_property_getters
|
|
51
|
+
(()=>{
|
|
52
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
53
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: definition[key]
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
})();
|
|
59
|
+
// webpack/runtime/has_own_property
|
|
60
|
+
(()=>{
|
|
61
|
+
__webpack_require__.o = function(obj, prop) {
|
|
62
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
63
|
+
};
|
|
64
|
+
})();
|
|
65
|
+
// webpack/runtime/make_namespace_object
|
|
66
|
+
(()=>{
|
|
67
|
+
// define __esModule on exports
|
|
68
|
+
__webpack_require__.r = function(exports1) {
|
|
69
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
70
|
+
value: 'Module'
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
73
|
+
value: true
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
})();
|
|
77
|
+
/************************************************************************/ var __webpack_exports__ = {};
|
|
78
|
+
__webpack_require__.r(__webpack_exports__);
|
|
79
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
80
|
+
default: function() {
|
|
81
|
+
return __WEBPACK_DEFAULT_EXPORT__;
|
|
82
|
+
},
|
|
83
|
+
raw: function() {
|
|
84
|
+
return raw;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
/* ESM import */ var _transformLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/loader/transformLoader.ts");
|
|
88
|
+
/* ESM default export */ const __WEBPACK_DEFAULT_EXPORT__ = _transformLoader__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
89
|
+
// make the loader to receive raw Buffer
|
|
90
|
+
const raw = true;
|
|
91
|
+
var __webpack_export_target__ = exports;
|
|
92
|
+
for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];
|
|
93
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
94
|
+
value: true
|
|
95
|
+
});
|
|
59
96
|
|
|
60
|
-
// src/loader/transformRawLoader.ts
|
|
61
|
-
var transformRawLoader_default = transform;
|
|
62
|
-
var raw = true;
|
|
63
97
|
// Annotate the CommonJS export names for ESM import in node:
|
|
64
98
|
0 && (module.exports = {
|
|
65
|
-
|
|
66
|
-
|
|
99
|
+
PLUGIN_CSS_NAME,
|
|
100
|
+
PLUGIN_SWC_NAME,
|
|
101
|
+
__internalHelper,
|
|
102
|
+
createRsbuild,
|
|
103
|
+
defineConfig,
|
|
104
|
+
ensureAssetPrefix,
|
|
105
|
+
loadConfig,
|
|
106
|
+
loadEnv,
|
|
107
|
+
logger,
|
|
108
|
+
mergeRsbuildConfig,
|
|
109
|
+
rspack,
|
|
110
|
+
version
|
|
111
|
+
});
|
package/dist-types/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WatchOptions } from '../compiled/chokidar';
|
|
1
|
+
import type { WatchOptions } from '../compiled/chokidar/index.js';
|
|
2
2
|
import type { InspectConfigOptions, InspectConfigResult, NormalizedConfig, PluginManager, PublicDir, PublicDirOptions, RsbuildConfig, RsbuildEntry } from './types';
|
|
3
3
|
export declare function getDefaultEntry(root: string): RsbuildEntry;
|
|
4
4
|
export declare const withDefaultConfig: (rootPath: string, config: RsbuildConfig) => Promise<RsbuildConfig>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import RspackChain from '../compiled/rspack-chain';
|
|
1
|
+
import RspackChain from '../compiled/rspack-chain/index.js';
|
|
2
2
|
import type { InternalContext, ModifyBundlerChainUtils, Rspack } from './types';
|
|
3
3
|
export declare function getBundlerChain(): RspackChain;
|
|
4
4
|
export declare function modifyBundlerChain(context: InternalContext, utils: ModifyBundlerChainUtils): Promise<RspackChain>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type RspackChain from '../../compiled/rspack-chain';
|
|
2
1
|
import type { Compiler as WebpackCompiler, MultiCompiler as WebpackMultiCompiler } from 'webpack';
|
|
2
|
+
import color from '../../compiled/picocolors/index.js';
|
|
3
|
+
import type RspackChain from '../../compiled/rspack-chain/index.js';
|
|
3
4
|
import type { FilenameConfig, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildTarget, Rspack } from '../types';
|
|
4
5
|
export * from './fs';
|
|
5
6
|
export * from './path';
|
|
6
7
|
export * from './stats';
|
|
8
|
+
export { color };
|
|
7
9
|
export declare const rspackMinVersion = "1.0.0";
|
|
8
10
|
export declare const getNodeEnv: () => string;
|
|
9
11
|
export declare const setNodeEnv: (env: string) => void;
|
package/dist-types/logger.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RsbuildPlugin } from '
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
2
|
export declare const pluginLazyCompilation: () => RsbuildPlugin;
|
|
@@ -18,7 +18,7 @@ export type DevMiddlewareOptions = {
|
|
|
18
18
|
etag?: 'weak' | 'strong';
|
|
19
19
|
/** The options need by compiler middleware (like webpackMiddleware) */
|
|
20
20
|
headers?: Record<string, string | string[]>;
|
|
21
|
-
writeToDisk?: boolean | ((filename: string) => boolean);
|
|
21
|
+
writeToDisk?: boolean | ((filename: string, compilationName?: string) => boolean);
|
|
22
22
|
stats?: boolean;
|
|
23
23
|
/** should trigger when compiler hook called */
|
|
24
24
|
callbacks: MiddlewareCallbacks;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IncomingMessage } from 'node:http';
|
|
2
2
|
import type { Socket } from 'node:net';
|
|
3
|
-
import type { DevConfig, Rspack, ServerConfig } from '../types';
|
|
3
|
+
import type { EnvironmentContext, DevConfig as OriginDevConfig, Rspack, ServerConfig } from '../types';
|
|
4
4
|
import { type DevMiddlewareAPI } from './devMiddleware';
|
|
5
5
|
type Options = {
|
|
6
6
|
publicPaths: string[];
|
|
7
|
-
|
|
7
|
+
environments: Record<string, EnvironmentContext>;
|
|
8
|
+
dev: OriginDevConfig;
|
|
8
9
|
server: ServerConfig;
|
|
9
10
|
compiler: Rspack.Compiler | Rspack.MultiCompiler;
|
|
10
11
|
};
|
|
@@ -20,7 +21,7 @@ export declare class CompilerDevMiddleware {
|
|
|
20
21
|
private compiler;
|
|
21
22
|
private publicPaths;
|
|
22
23
|
private socketServer;
|
|
23
|
-
constructor({ dev, server, compiler, publicPaths }: Options);
|
|
24
|
+
constructor({ dev, server, compiler, publicPaths, environments }: Options);
|
|
24
25
|
init(): Promise<void>;
|
|
25
26
|
upgrade(req: IncomingMessage, sock: Socket, head: any): void;
|
|
26
27
|
close(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import type Connect from '../../compiled/connect';
|
|
3
|
+
import type Connect from '../../compiled/connect/index.js';
|
|
4
4
|
import type { CreateCompiler, CreateDevServerOptions, EnvironmentAPI, InternalContext, NormalizedConfig } from '../types';
|
|
5
5
|
type HTTPServer = Server | Http2SecureServer;
|
|
6
6
|
export type RsbuildDevServer = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import type Connect from '../../compiled/connect';
|
|
3
|
+
import type Connect from '../../compiled/connect/index.js';
|
|
4
4
|
import type { ServerConfig } from '../types';
|
|
5
5
|
export declare const createHttpServer: ({ serverConfig, middlewares, }: {
|
|
6
6
|
serverConfig: ServerConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type Connect from '../../compiled/connect';
|
|
1
|
+
import type Connect from '../../compiled/connect/index.js';
|
|
2
2
|
import type { EnvironmentAPI, HtmlFallback, RequestHandler as Middleware, Rspack } from '../types';
|
|
3
3
|
export declare const faviconFallbackMiddleware: Middleware;
|
|
4
4
|
export declare const getRequestLoggerMiddleware: () => Promise<Connect.NextHandleFunction>;
|
|
@@ -27,7 +27,7 @@ export declare const getHtmlFallbackMiddleware: (params: {
|
|
|
27
27
|
outputFileSystem: Rspack.OutputFileSystem;
|
|
28
28
|
}) => Middleware;
|
|
29
29
|
/**
|
|
30
|
-
* Support viewing served files via
|
|
30
|
+
* Support viewing served files via `/rsbuild-dev-server` route
|
|
31
31
|
*/
|
|
32
32
|
export declare const viewingServedFilesMiddleware: (params: {
|
|
33
33
|
environments: EnvironmentAPI;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import type Connect from '../../compiled/connect';
|
|
3
|
+
import type Connect from '../../compiled/connect/index.js';
|
|
4
4
|
import type { InternalContext, NormalizedConfig, PreviewOptions, ServerConfig } from '../types';
|
|
5
5
|
import { type StartServerResult } from './helper';
|
|
6
6
|
type RsbuildProdServerOptions = {
|
|
@@ -2,10 +2,10 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
2
2
|
import type { SecureServerSessionOptions } from 'node:http2';
|
|
3
3
|
import type { ServerOptions as HttpsServerOptions } from 'node:https';
|
|
4
4
|
import type { Configuration, CopyRspackPluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions, rspack } from '@rspack/core';
|
|
5
|
-
import type { WatchOptions } from '../../compiled/chokidar';
|
|
6
|
-
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware';
|
|
7
|
-
import type RspackChain from '../../compiled/rspack-chain';
|
|
8
|
-
import type { BundleAnalyzerPlugin } from '../../compiled/webpack-bundle-analyzer';
|
|
5
|
+
import type { WatchOptions } from '../../compiled/chokidar/index.js';
|
|
6
|
+
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware/index.js';
|
|
7
|
+
import type RspackChain from '../../compiled/rspack-chain/index.js';
|
|
8
|
+
import type { BundleAnalyzerPlugin } from '../../compiled/webpack-bundle-analyzer/index.js';
|
|
9
9
|
import type { ModifyBundlerChainUtils, ModifyChainUtils, Routes } from './hooks';
|
|
10
10
|
import type { ModifyWebpackChainUtils, ModifyWebpackConfigUtils, RsbuildPlugins } from './plugin';
|
|
11
11
|
import type { RsbuildEntry, RsbuildMode, RsbuildTarget } from './rsbuild';
|
|
@@ -29,7 +29,7 @@ export type ModifyRspackConfigUtils = ModifyChainUtils & {
|
|
|
29
29
|
prependPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
|
|
30
30
|
appendPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
|
|
31
31
|
removePlugin: (pluginName: string) => void;
|
|
32
|
-
mergeConfig: typeof import('../../compiled/webpack-merge').merge;
|
|
32
|
+
mergeConfig: typeof import('../../compiled/webpack-merge/index.js').merge;
|
|
33
33
|
rspack: typeof rspack;
|
|
34
34
|
};
|
|
35
35
|
export type ToolsRspackConfig = ConfigChainAsyncWithContext<Rspack.Configuration, ModifyRspackConfigUtils>;
|
|
@@ -1112,7 +1112,7 @@ export interface EnvironmentConfig {
|
|
|
1112
1112
|
/**
|
|
1113
1113
|
* Options for local development.
|
|
1114
1114
|
*/
|
|
1115
|
-
dev?: Pick<DevConfig, 'hmr' | 'assetPrefix' | 'progressBar' | 'lazyCompilation'>;
|
|
1115
|
+
dev?: Pick<DevConfig, 'hmr' | 'assetPrefix' | 'progressBar' | 'lazyCompilation' | 'writeToDisk'>;
|
|
1116
1116
|
/**
|
|
1117
1117
|
* Options for HTML generation.
|
|
1118
1118
|
*/
|
|
@@ -1186,7 +1186,7 @@ export interface RsbuildConfig extends EnvironmentConfig {
|
|
|
1186
1186
|
export type MergedEnvironmentConfig = {
|
|
1187
1187
|
mode: RsbuildMode;
|
|
1188
1188
|
root: string;
|
|
1189
|
-
dev: Pick<NormalizedDevConfig, 'hmr' | 'assetPrefix' | 'progressBar' | 'lazyCompilation'>;
|
|
1189
|
+
dev: Pick<NormalizedDevConfig, 'hmr' | 'assetPrefix' | 'progressBar' | 'lazyCompilation' | 'writeToDisk'>;
|
|
1190
1190
|
html: NormalizedHtmlConfig;
|
|
1191
1191
|
tools: NormalizedToolsConfig;
|
|
1192
1192
|
source: NormalizedSourceConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type RspackChain from '../../compiled/rspack-chain';
|
|
2
1
|
import type { ChainIdentifier } from '..';
|
|
2
|
+
import type RspackChain from '../../compiled/rspack-chain/index.js';
|
|
3
3
|
import type { EnvironmentConfig, HtmlBasicTag, MergedEnvironmentConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config';
|
|
4
4
|
import type { RsbuildEntry, RsbuildTarget } from './rsbuild';
|
|
5
5
|
import type { Rspack } from './rspack';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type RspackChain from '../../compiled/rspack-chain';
|
|
2
1
|
import type { RuleSetRule, Configuration as WebpackConfig, WebpackPluginInstance } from 'webpack';
|
|
2
|
+
import type RspackChain from '../../compiled/rspack-chain/index.js';
|
|
3
3
|
import type { ChainIdentifier } from '../configChain';
|
|
4
4
|
import type { ModifyRspackConfigUtils, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config';
|
|
5
5
|
import type { RsbuildContext } from './context';
|
|
@@ -55,7 +55,7 @@ export type ModifyWebpackConfigUtils = ModifyWebpackChainUtils & {
|
|
|
55
55
|
prependPlugins: (plugins: WebpackPluginInstance | WebpackPluginInstance[]) => void;
|
|
56
56
|
appendPlugins: (plugins: WebpackPluginInstance | WebpackPluginInstance[]) => void;
|
|
57
57
|
removePlugin: (pluginName: string) => void;
|
|
58
|
-
mergeConfig: typeof import('
|
|
58
|
+
mergeConfig: typeof import('../../compiled/webpack-merge/index.js').merge;
|
|
59
59
|
};
|
|
60
60
|
export type ModifyWebpackChainFn = (chain: RspackChain, utils: ModifyWebpackChainUtils) => Promise<void> | void;
|
|
61
61
|
export type ModifyWebpackConfigFn = (config: WebpackConfig, utils: ModifyWebpackConfigUtils) => Promise<WebpackConfig | void> | WebpackConfig | void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Rspack from '@rspack/core';
|
|
2
|
-
import type RspackChain from '../../compiled/rspack-chain';
|
|
2
|
+
import type RspackChain from '../../compiled/rspack-chain/index.js';
|
|
3
3
|
import type { TransformHandler } from './plugin';
|
|
4
4
|
export type { Rspack, RspackChain };
|
|
5
5
|
declare module '@rspack/core' {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from '@rspack/core';
|
|
2
|
-
import type HtmlRspackPlugin from '../../compiled/html-rspack-plugin';
|
|
3
2
|
import type { AcceptedPlugin, ProcessOptions } from 'postcss';
|
|
4
3
|
import type { Configuration as WebpackConfig } from 'webpack';
|
|
4
|
+
import type HtmlRspackPlugin from '../../compiled/html-rspack-plugin/index.js';
|
|
5
5
|
import type { Rspack } from './rspack';
|
|
6
6
|
export type { HtmlRspackPlugin };
|
|
7
7
|
export interface CSSExtractOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -46,19 +46,20 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "~1.1.
|
|
49
|
+
"@rspack/core": "~1.1.1",
|
|
50
50
|
"@rspack/lite-tapable": "~1.0.1",
|
|
51
|
-
"@swc/helpers": "^0.5.
|
|
51
|
+
"@swc/helpers": "^0.5.15",
|
|
52
52
|
"core-js": "~3.39.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@rslib/core": "0.0.18",
|
|
55
56
|
"@types/connect": "3.4.38",
|
|
56
57
|
"@types/fs-extra": "^11.0.4",
|
|
57
|
-
"@types/node": "
|
|
58
|
+
"@types/node": "^22.9.0",
|
|
58
59
|
"@types/on-finished": "2.3.4",
|
|
59
60
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
60
61
|
"@types/ws": "^8.5.13",
|
|
61
|
-
"browserslist-load-config": "0.
|
|
62
|
+
"browserslist-load-config": "1.0.0",
|
|
62
63
|
"chokidar": "3.6.0",
|
|
63
64
|
"commander": "^12.1.0",
|
|
64
65
|
"connect": "3.7.0",
|
|
@@ -76,18 +77,18 @@
|
|
|
76
77
|
"on-finished": "2.4.1",
|
|
77
78
|
"open": "^8.4.0",
|
|
78
79
|
"picocolors": "^1.1.1",
|
|
79
|
-
"postcss": "^8.4.
|
|
80
|
+
"postcss": "^8.4.48",
|
|
80
81
|
"postcss-load-config": "6.0.1",
|
|
81
82
|
"postcss-loader": "8.1.1",
|
|
82
83
|
"prebundle": "1.2.5",
|
|
83
84
|
"reduce-configs": "^1.0.0",
|
|
84
|
-
"
|
|
85
|
+
"rimraf": "^6.0.1",
|
|
86
|
+
"rsbuild-dev-middleware": "0.1.2",
|
|
85
87
|
"rslog": "^1.2.3",
|
|
86
88
|
"rspack-chain": "^1.0.3",
|
|
87
89
|
"rspack-manifest-plugin": "5.0.2",
|
|
88
90
|
"sirv": "^3.0.0",
|
|
89
91
|
"style-loader": "3.3.4",
|
|
90
|
-
"tsc-alias": "^1.8.10",
|
|
91
92
|
"typescript": "^5.6.3",
|
|
92
93
|
"webpack": "^5.96.1",
|
|
93
94
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
@@ -106,8 +107,8 @@
|
|
|
106
107
|
"registry": "https://registry.npmjs.org/"
|
|
107
108
|
},
|
|
108
109
|
"scripts": {
|
|
109
|
-
"build": "
|
|
110
|
-
"dev": "
|
|
110
|
+
"build": "rslib build",
|
|
111
|
+
"dev": "rslib build --watch",
|
|
111
112
|
"prebundle": "prebundle"
|
|
112
113
|
}
|
|
113
114
|
}
|