robuild 0.0.12 → 0.0.13
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.
|
@@ -27,10 +27,20 @@ import "minimatch";
|
|
|
27
27
|
/**
|
|
28
28
|
* Create skip node_modules plugin
|
|
29
29
|
*/
|
|
30
|
-
function createSkipNodeModulesPlugin() {
|
|
30
|
+
function createSkipNodeModulesPlugin(options) {
|
|
31
|
+
const noExternalPatterns = options?.noExternal || [];
|
|
32
|
+
const shouldInline = (id) => {
|
|
33
|
+
for (const pattern of noExternalPatterns) if (typeof pattern === "string") {
|
|
34
|
+
if (id === pattern || id.startsWith(`${pattern}/`)) return true;
|
|
35
|
+
} else if (pattern instanceof RegExp) {
|
|
36
|
+
if (pattern.test(id)) return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
31
40
|
return {
|
|
32
41
|
name: "skip-node-modules",
|
|
33
|
-
resolveId: async (id
|
|
42
|
+
resolveId: async (id) => {
|
|
43
|
+
if (shouldInline(id)) return null;
|
|
34
44
|
if (id.includes("node_modules") || !id.startsWith(".") && !id.startsWith("/")) return {
|
|
35
45
|
id,
|
|
36
46
|
external: true
|
|
@@ -1119,7 +1129,7 @@ async function rolldownBuild(ctx, entry, hooks, config) {
|
|
|
1119
1129
|
});
|
|
1120
1130
|
}
|
|
1121
1131
|
if (entry.skipNodeModules) {
|
|
1122
|
-
const skipPlugin = createSkipNodeModulesPlugin();
|
|
1132
|
+
const skipPlugin = createSkipNodeModulesPlugin({ noExternal: ["@oxc-project/runtime"] });
|
|
1123
1133
|
if (skipPlugin.resolveId) rolldownPlugins.push({
|
|
1124
1134
|
name: "skip-node-modules",
|
|
1125
1135
|
resolveId: skipPlugin.resolveId
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region package.json
|
|
2
2
|
var name = "robuild";
|
|
3
3
|
var type = "module";
|
|
4
|
-
var version = "0.0.
|
|
4
|
+
var version = "0.0.13";
|
|
5
5
|
var packageManager = "pnpm@10.11.1";
|
|
6
6
|
var description = "Zero-config ESM/TS package builder. Powered by Rolldown and Oxc";
|
|
7
7
|
var license = "MIT";
|
package/dist/cli.mjs
CHANGED
package/dist/index.mjs
CHANGED