@pob/rollup-esbuild 10.0.1 → 10.2.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,6 +1,10 @@
1
1
  import { chmodSync, readFileSync } from "node:fs";
2
2
  import path from "node:path";
3
- import { nodeFormatToExt, resolveEntry } from "@pob/rollup";
3
+ import {
4
+ createSourceWorkspaceDependencies,
5
+ nodeFormatToExt,
6
+ resolveEntry,
7
+ } from "@pob/rollup";
4
8
  import { nodeResolve } from "@rollup/plugin-node-resolve";
5
9
  import replace from "@rollup/plugin-replace";
6
10
  import configExternalDependencies from "rollup-config-external-dependencies";
@@ -25,7 +29,17 @@ export default function createRollupConfig({
25
29
  }
26
30
 
27
31
  const jsx = pobConfig.jsx;
28
- const externalByPackageJson = configExternalDependencies(pkg);
32
+ const sourceWorkspaceDependencies = createSourceWorkspaceDependencies(
33
+ cwd,
34
+ pkg,
35
+ );
36
+ const externalByPackageJson = configExternalDependencies([
37
+ pkg,
38
+ ...sourceWorkspaceDependencies.pkgs,
39
+ ]);
40
+ const external = (id) =>
41
+ !sourceWorkspaceDependencies.isSourceWorkspaceDependency(id) &&
42
+ externalByPackageJson(id);
29
43
 
30
44
  const createConfigForEnv = (entry, entryPath, env) => {
31
45
  const extensions = getExtensions(
@@ -70,8 +84,9 @@ export default function createRollupConfig({
70
84
  warn(warning);
71
85
  },
72
86
 
73
- external: externalByPackageJson,
87
+ external,
74
88
  plugins: [
89
+ sourceWorkspaceDependencies.plugin,
75
90
  esbuild({
76
91
  loaders: {
77
92
  // https://github.com/egoist/rollup-plugin-esbuild/issues/384
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/rollup-esbuild",
3
- "version": "10.0.1",
3
+ "version": "10.2.0",
4
4
  "description": "rollup configuration with typescript for pob",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/christophehurpeau/pob",
@@ -39,14 +39,14 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
+ "@pob/rollup": "8.3.0",
42
43
  "@rollup/plugin-node-resolve": "16.0.3",
43
44
  "@rollup/plugin-replace": "6.0.3",
44
45
  "@rollup/plugin-run": "3.1.0",
45
46
  "esbuild": "0.28.2",
46
47
  "rollup": "4.60.4",
47
48
  "rollup-config-external-dependencies": "^3.0.1",
48
- "rollup-plugin-esbuild": "6.2.1",
49
- "@pob/rollup": "8.1.3"
49
+ "rollup-plugin-esbuild": "6.2.1"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "rollup": "4.60.4",
@@ -64,6 +64,6 @@
64
64
  "scripts": {
65
65
  "lint": "pnpm run lint:oxlint && pnpm run lint:eslint",
66
66
  "lint:eslint": "pnpm --dir '../..' exec eslint --quiet '@pob/rollup-esbuild'",
67
- "lint:oxlint": "pnpm --dir '../..' exec oxlint '@pob/rollup-esbuild'"
67
+ "lint:oxlint": "pnpm --dir '../..' exec oxlint --quiet '@pob/rollup-esbuild'"
68
68
  }
69
69
  }