@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@wrdagency/react-islands",
4
- "version": "2.1.4",
4
+ "version": "2.1.5",
5
5
  "description": "",
6
6
  "main": "./dist/index.js",
7
7
  "files": [
@@ -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, ssg, jsx, typescript, common, define } =
25
- config;
25
+ const { name, input, output, minify, jsx, typescript, define } = config;
26
26
 
27
- const { subName, format, globals = {}, prefix, suffix, plugins = [] } = opts;
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: () =>