@wrdagency/react-islands 2.1.4 → 2.1.5
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/package.json +1 -1
- package/src/bin/rollup/island.ts +13 -4
package/package.json
CHANGED
package/src/bin/rollup/island.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { runRollups, watchRollup } from "./run";
|
|
|
13
13
|
function createIslandRollupConfig(
|
|
14
14
|
config: IndividualIslandConfigOptions,
|
|
15
15
|
opts: {
|
|
16
|
+
external?: string[];
|
|
16
17
|
subName: string;
|
|
17
18
|
format: ModuleFormat;
|
|
18
19
|
globals?: Record<string, string>;
|
|
@@ -21,14 +22,21 @@ function createIslandRollupConfig(
|
|
|
21
22
|
plugins?: Plugin[];
|
|
22
23
|
}
|
|
23
24
|
): RollupOptions {
|
|
24
|
-
const { name, input, output, minify,
|
|
25
|
-
config;
|
|
25
|
+
const { name, input, output, minify, jsx, typescript, define } = config;
|
|
26
26
|
|
|
27
|
-
const {
|
|
27
|
+
const {
|
|
28
|
+
external = [],
|
|
29
|
+
subName,
|
|
30
|
+
format,
|
|
31
|
+
globals = {},
|
|
32
|
+
prefix,
|
|
33
|
+
suffix,
|
|
34
|
+
plugins = [],
|
|
35
|
+
} = opts;
|
|
28
36
|
|
|
29
37
|
return {
|
|
30
38
|
input,
|
|
31
|
-
external: Object.keys(globals),
|
|
39
|
+
external: [...Object.keys(globals), ...external],
|
|
32
40
|
jsx,
|
|
33
41
|
output: {
|
|
34
42
|
name: `Islands.${name}`,
|
|
@@ -99,6 +107,7 @@ export function createIslandRollupConfigServer(
|
|
|
99
107
|
config: IndividualIslandConfigOptions
|
|
100
108
|
): RollupOptions {
|
|
101
109
|
return createIslandRollupConfig(config, {
|
|
110
|
+
external: ["react", "react-dom"],
|
|
102
111
|
subName: "server.cjs",
|
|
103
112
|
format: "cjs",
|
|
104
113
|
suffix: () =>
|