@modern-js/builder 3.0.0-alpha.0 → 3.0.0-alpha.2
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/dist/cjs/createBuilder.js +96 -0
- package/dist/cjs/index.js +59 -0
- package/dist/cjs/plugins/devtools.js +47 -0
- package/dist/cjs/plugins/emitRouteFile.js +75 -0
- package/dist/cjs/plugins/environmentDefaults.js +100 -0
- package/dist/cjs/plugins/globalVars.js +55 -0
- package/dist/cjs/plugins/htmlMinify.js +115 -0
- package/dist/cjs/plugins/manifest.js +52 -0
- package/dist/cjs/plugins/postcss.js +118 -0
- package/dist/cjs/plugins/runtimeChunk.js +54 -0
- package/dist/cjs/rsc/common.js +157 -0
- package/dist/cjs/rsc/plugins/rsbuild-rsc-plugin.js +169 -0
- package/dist/cjs/rsc/plugins/rspack-rsc-client-plugin.js +187 -0
- package/dist/cjs/rsc/plugins/rspack-rsc-server-plugin.js +245 -0
- package/dist/cjs/rsc/rsc-client-loader.js +71 -0
- package/dist/cjs/rsc/rsc-css-loader.js +42 -0
- package/dist/cjs/rsc/rsc-server-loader.js +102 -0
- package/dist/cjs/rsc/rsc-ssr-loader.js +60 -0
- package/dist/cjs/shared/devServer.js +87 -0
- package/dist/cjs/shared/getCssSupport.js +121 -0
- package/dist/cjs/shared/manifest.js +46 -0
- package/dist/cjs/shared/parseCommonConfig.js +209 -0
- package/dist/cjs/shared/rsc/rscClientBrowserFallback.js +64 -0
- package/dist/cjs/shared/rsc/rscEmptyModule.js +36 -0
- package/dist/cjs/shared/utils.js +115 -0
- package/dist/cjs/types.js +18 -0
- package/dist/compiled/postcss-load-config/index.d.ts +1 -0
- package/dist/compiled/postcss-load-config/index.js +608 -0
- package/dist/compiled/postcss-load-config/index.js.LICENSE.txt +13 -0
- package/dist/compiled/postcss-load-config/license +20 -0
- package/dist/compiled/postcss-load-config/package.json +1 -0
- package/dist/esm/createBuilder.mjs +59 -0
- package/dist/esm/index.mjs +4 -0
- package/dist/esm/plugins/devtools.mjs +13 -0
- package/dist/esm/plugins/emitRouteFile.mjs +28 -0
- package/dist/esm/plugins/environmentDefaults.mjs +66 -0
- package/dist/esm/plugins/globalVars.mjs +21 -0
- package/dist/esm/plugins/htmlMinify.mjs +81 -0
- package/dist/esm/plugins/manifest.mjs +18 -0
- package/dist/esm/plugins/postcss.mjs +81 -0
- package/dist/esm/plugins/runtimeChunk.mjs +20 -0
- package/dist/esm/rsc/common.mjs +87 -0
- package/dist/esm/rsc/plugins/rsbuild-rsc-plugin.mjs +124 -0
- package/dist/esm/rsc/plugins/rspack-rsc-client-plugin.mjs +143 -0
- package/dist/esm/rsc/plugins/rspack-rsc-server-plugin.mjs +211 -0
- package/dist/esm/rsc/rsc-client-loader.mjs +37 -0
- package/dist/esm/rsc/rsc-css-loader.mjs +8 -0
- package/dist/esm/rsc/rsc-server-loader.mjs +58 -0
- package/dist/esm/rsc/rsc-ssr-loader.mjs +26 -0
- package/dist/esm/shared/devServer.mjs +53 -0
- package/dist/esm/shared/getCssSupport.mjs +77 -0
- package/dist/esm/shared/manifest.mjs +12 -0
- package/dist/esm/shared/parseCommonConfig.mjs +172 -0
- package/dist/esm/shared/rsc/rscClientBrowserFallback.mjs +20 -0
- package/dist/esm/shared/rsc/rscEmptyModule.mjs +2 -0
- package/dist/esm/shared/utils.mjs +53 -0
- package/dist/esm/types.mjs +0 -0
- package/dist/esm-node/createBuilder.mjs +61 -0
- package/dist/esm-node/index.mjs +6 -0
- package/dist/esm-node/plugins/devtools.mjs +15 -0
- package/dist/esm-node/plugins/emitRouteFile.mjs +30 -0
- package/dist/esm-node/plugins/environmentDefaults.mjs +68 -0
- package/dist/esm-node/plugins/globalVars.mjs +23 -0
- package/dist/esm-node/plugins/htmlMinify.mjs +83 -0
- package/dist/esm-node/plugins/manifest.mjs +20 -0
- package/dist/esm-node/plugins/postcss.mjs +83 -0
- package/dist/esm-node/plugins/runtimeChunk.mjs +22 -0
- package/dist/esm-node/rsc/common.mjs +89 -0
- package/dist/esm-node/rsc/plugins/rsbuild-rsc-plugin.mjs +126 -0
- package/dist/esm-node/rsc/plugins/rspack-rsc-client-plugin.mjs +145 -0
- package/dist/esm-node/rsc/plugins/rspack-rsc-server-plugin.mjs +213 -0
- package/dist/esm-node/rsc/rsc-client-loader.mjs +39 -0
- package/dist/esm-node/rsc/rsc-css-loader.mjs +10 -0
- package/dist/esm-node/rsc/rsc-server-loader.mjs +60 -0
- package/dist/esm-node/rsc/rsc-ssr-loader.mjs +28 -0
- package/dist/esm-node/shared/devServer.mjs +55 -0
- package/dist/esm-node/shared/getCssSupport.mjs +79 -0
- package/dist/esm-node/shared/manifest.mjs +14 -0
- package/dist/esm-node/shared/parseCommonConfig.mjs +174 -0
- package/dist/esm-node/shared/rsc/rscClientBrowserFallback.mjs +25 -0
- package/dist/esm-node/shared/rsc/rscEmptyModule.mjs +4 -0
- package/dist/esm-node/shared/utils.mjs +55 -0
- package/dist/esm-node/types.mjs +2 -0
- package/dist/types/shared/rsc/rscClientBrowserFallback.d.ts +2 -0
- package/dist/types/shared/rsc/rscEmptyModule.d.ts +2 -0
- package/dist/{types.d.ts → types/types.d.ts} +2 -16
- package/package.json +36 -31
- package/dist/createBuilder.js +0 -153
- package/dist/index.js +0 -45
- package/dist/plugins/babel-post.d.ts +0 -5
- package/dist/plugins/babel-post.js +0 -57
- package/dist/plugins/devtools.js +0 -42
- package/dist/plugins/emitRouteFile.js +0 -70
- package/dist/plugins/environmentDefaults.js +0 -99
- package/dist/plugins/globalVars.js +0 -50
- package/dist/plugins/htmlMinify.js +0 -126
- package/dist/plugins/manifest.js +0 -54
- package/dist/plugins/postcss.js +0 -133
- package/dist/plugins/runtimeChunk.js +0 -55
- package/dist/rsc/common.js +0 -174
- package/dist/rsc/plugins/rsbuild-rsc-plugin.js +0 -166
- package/dist/rsc/plugins/rspack-rsc-client-plugin.js +0 -233
- package/dist/rsc/plugins/rspack-rsc-server-plugin.js +0 -290
- package/dist/rsc/rsc-client-loader.js +0 -70
- package/dist/rsc/rsc-css-loader.js +0 -30
- package/dist/rsc/rsc-server-loader.js +0 -95
- package/dist/rsc/rsc-ssr-loader.js +0 -58
- package/dist/shared/devServer.js +0 -83
- package/dist/shared/getCssSupport.js +0 -113
- package/dist/shared/manifest.js +0 -38
- package/dist/shared/parseCommonConfig.js +0 -232
- package/dist/shared/utils.js +0 -109
- package/dist/types.js +0 -16
- /package/dist/{createBuilder.d.ts → types/createBuilder.d.ts} +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{plugins → types/plugins}/devtools.d.ts +0 -0
- /package/dist/{plugins → types/plugins}/emitRouteFile.d.ts +0 -0
- /package/dist/{plugins → types/plugins}/environmentDefaults.d.ts +0 -0
- /package/dist/{plugins → types/plugins}/globalVars.d.ts +0 -0
- /package/dist/{plugins → types/plugins}/htmlMinify.d.ts +0 -0
- /package/dist/{plugins → types/plugins}/manifest.d.ts +0 -0
- /package/dist/{plugins → types/plugins}/postcss.d.ts +0 -0
- /package/dist/{plugins → types/plugins}/runtimeChunk.d.ts +0 -0
- /package/dist/{rsc → types/rsc}/common.d.ts +0 -0
- /package/dist/{rsc → types/rsc}/plugins/rsbuild-rsc-plugin.d.ts +0 -0
- /package/dist/{rsc → types/rsc}/plugins/rspack-rsc-client-plugin.d.ts +0 -0
- /package/dist/{rsc → types/rsc}/plugins/rspack-rsc-server-plugin.d.ts +0 -0
- /package/dist/{rsc → types/rsc}/rsc-client-loader.d.ts +0 -0
- /package/dist/{rsc → types/rsc}/rsc-css-loader.d.ts +0 -0
- /package/dist/{rsc → types/rsc}/rsc-server-loader.d.ts +0 -0
- /package/dist/{rsc → types/rsc}/rsc-ssr-loader.d.ts +0 -0
- /package/dist/{shared → types/shared}/devServer.d.ts +0 -0
- /package/dist/{shared → types/shared}/getCssSupport.d.ts +0 -0
- /package/dist/{shared → types/shared}/manifest.d.ts +0 -0
- /package/dist/{shared → types/shared}/parseCommonConfig.d.ts +0 -0
- /package/dist/{shared → types/shared}/utils.d.ts +0 -0
package/dist/shared/utils.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var utils_exports = {};
|
|
30
|
-
__export(utils_exports, {
|
|
31
|
-
NODE_MODULES_REGEX: () => NODE_MODULES_REGEX,
|
|
32
|
-
RUNTIME_CHUNK_NAME: () => RUNTIME_CHUNK_NAME,
|
|
33
|
-
RUNTIME_CHUNK_REGEX: () => RUNTIME_CHUNK_REGEX,
|
|
34
|
-
SERVICE_WORKER_ENVIRONMENT_NAME: () => SERVICE_WORKER_ENVIRONMENT_NAME,
|
|
35
|
-
castArray: () => castArray,
|
|
36
|
-
getBrowserslistWithDefault: () => getBrowserslistWithDefault,
|
|
37
|
-
isHtmlDisabled: () => isHtmlDisabled
|
|
38
|
-
});
|
|
39
|
-
module.exports = __toCommonJS(utils_exports);
|
|
40
|
-
var import_browserslist = __toESM(require("browserslist"));
|
|
41
|
-
const RUNTIME_CHUNK_NAME = "builder-runtime";
|
|
42
|
-
const RUNTIME_CHUNK_REGEX = new RegExp(`${RUNTIME_CHUNK_NAME}([.].+)?\\.js$`);
|
|
43
|
-
const SERVICE_WORKER_ENVIRONMENT_NAME = "workerSSR";
|
|
44
|
-
const NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/;
|
|
45
|
-
const castArray = (arr) => {
|
|
46
|
-
if (arr === void 0) {
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
|
-
return Array.isArray(arr) ? arr : [
|
|
50
|
-
arr
|
|
51
|
-
];
|
|
52
|
-
};
|
|
53
|
-
const browsersListCache = /* @__PURE__ */ new Map();
|
|
54
|
-
async function getBrowserslist(path) {
|
|
55
|
-
const env = process.env.NODE_ENV;
|
|
56
|
-
const cacheKey = `${path}${env}`;
|
|
57
|
-
if (browsersListCache.has(cacheKey)) {
|
|
58
|
-
return browsersListCache.get(cacheKey);
|
|
59
|
-
}
|
|
60
|
-
const result = import_browserslist.default.loadConfig({
|
|
61
|
-
path,
|
|
62
|
-
env
|
|
63
|
-
});
|
|
64
|
-
if (result) {
|
|
65
|
-
browsersListCache.set(cacheKey, result);
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
const isHtmlDisabled = (config, target) => {
|
|
71
|
-
const { htmlPlugin } = config.tools;
|
|
72
|
-
return htmlPlugin === false || Array.isArray(htmlPlugin) && htmlPlugin.includes(false) || target !== "web";
|
|
73
|
-
};
|
|
74
|
-
const DEFAULT_WEB_BROWSERSLIST = [
|
|
75
|
-
"chrome >= 87",
|
|
76
|
-
"edge >= 88",
|
|
77
|
-
"firefox >= 78",
|
|
78
|
-
"safari >= 14"
|
|
79
|
-
];
|
|
80
|
-
const DEFAULT_BROWSERSLIST = {
|
|
81
|
-
web: DEFAULT_WEB_BROWSERSLIST,
|
|
82
|
-
node: [
|
|
83
|
-
"node >= 16"
|
|
84
|
-
],
|
|
85
|
-
"web-worker": DEFAULT_WEB_BROWSERSLIST
|
|
86
|
-
};
|
|
87
|
-
async function getBrowserslistWithDefault(path, config, target) {
|
|
88
|
-
const { overrideBrowserslist: overrides } = (config === null || config === void 0 ? void 0 : config.output) || {};
|
|
89
|
-
if (target === "web" || target === "web-worker") {
|
|
90
|
-
if (overrides) {
|
|
91
|
-
return overrides;
|
|
92
|
-
}
|
|
93
|
-
const browserslistrc = await getBrowserslist(path);
|
|
94
|
-
if (browserslistrc) {
|
|
95
|
-
return browserslistrc;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return DEFAULT_BROWSERSLIST[target];
|
|
99
|
-
}
|
|
100
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
-
0 && (module.exports = {
|
|
102
|
-
NODE_MODULES_REGEX,
|
|
103
|
-
RUNTIME_CHUNK_NAME,
|
|
104
|
-
RUNTIME_CHUNK_REGEX,
|
|
105
|
-
SERVICE_WORKER_ENVIRONMENT_NAME,
|
|
106
|
-
castArray,
|
|
107
|
-
getBrowserslistWithDefault,
|
|
108
|
-
isHtmlDisabled
|
|
109
|
-
});
|
package/dist/types.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|