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, importer) => {
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.12";
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
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { build } from "./_chunks/build-BFnZNGy3.mjs";
2
+ import { build } from "./_chunks/build-C9gSlxzR.mjs";
3
3
  import { consola } from "consola";
4
4
  import { parseArgs } from "node:util";
5
5
  import { loadConfig } from "c12";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { build } from "./_chunks/build-BFnZNGy3.mjs";
1
+ import { build } from "./_chunks/build-C9gSlxzR.mjs";
2
2
  import { defineConfig } from "./_chunks/config-B_2eqpNJ.mjs";
3
3
 
4
4
  export { build, defineConfig };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "robuild",
3
3
  "type": "module",
4
- "version": "0.0.12",
4
+ "version": "0.0.13",
5
5
  "packageManager": "pnpm@10.11.1",
6
6
  "description": "Zero-config ESM/TS package builder. Powered by Rolldown and Oxc",
7
7
  "license": "MIT",