diff --git a/.changeset/gentle-dragons-scream.md b/.changeset/gentle-dragons-scream.md new file mode 100644 index 000000000..cacb156e9 --- /dev/null +++ b/.changeset/gentle-dragons-scream.md @@ -0,0 +1,5 @@ +--- +"@ebay/ebayui-core": patch +--- + +chore(@internal): added split imports diff --git a/src/node_modules/@internal/highcharts/dynamic-import.js b/src/node_modules/@internal/highcharts/dynamic-import.js index 331522417..fd20a69c9 100644 --- a/src/node_modules/@internal/highcharts/dynamic-import.js +++ b/src/node_modules/@internal/highcharts/dynamic-import.js @@ -1,10 +1,12 @@ -export function load() { - const modleLoader = import("./module-loader"); +module.exports = { + load: function () { + const modleLoader = import("./module-loader"); - return modleLoader.then((modules) => { - window.Highcharts = modules.highcharts; - modules.accessibility(window.Highcharts); - modules.patternFill(window.Highcharts); - return modules; - }); -} + return modleLoader.then((modules) => { + window.Highcharts = modules.highcharts; + modules.accessibility(window.Highcharts); + modules.patternFill(window.Highcharts); + return modules; + }); + }, +}; diff --git a/src/node_modules/@internal/highcharts/dynamic-import.mjs b/src/node_modules/@internal/highcharts/dynamic-import.mjs new file mode 100644 index 000000000..331522417 --- /dev/null +++ b/src/node_modules/@internal/highcharts/dynamic-import.mjs @@ -0,0 +1,10 @@ +export function load() { + const modleLoader = import("./module-loader"); + + return modleLoader.then((modules) => { + window.Highcharts = modules.highcharts; + modules.accessibility(window.Highcharts); + modules.patternFill(window.Highcharts); + return modules; + }); +} diff --git a/src/node_modules/@internal/highcharts/dynamic-legacy-import.js b/src/node_modules/@internal/highcharts/dynamic-legacy-import.js deleted file mode 100644 index fd20a69c9..000000000 --- a/src/node_modules/@internal/highcharts/dynamic-legacy-import.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - load: function () { - const modleLoader = import("./module-loader"); - - return modleLoader.then((modules) => { - window.Highcharts = modules.highcharts; - modules.accessibility(window.Highcharts); - modules.patternFill(window.Highcharts); - return modules; - }); - }, -}; diff --git a/src/node_modules/@internal/highcharts/noop-for-node.mjs b/src/node_modules/@internal/highcharts/noop-for-node.mjs new file mode 100644 index 000000000..524bdf9f6 --- /dev/null +++ b/src/node_modules/@internal/highcharts/noop-for-node.mjs @@ -0,0 +1,3 @@ +export function load() { + return Promise.reject(); +}; diff --git a/src/node_modules/@internal/highcharts/package.json b/src/node_modules/@internal/highcharts/package.json index 4638d8c73..8f2a536a8 100644 --- a/src/node_modules/@internal/highcharts/package.json +++ b/src/node_modules/@internal/highcharts/package.json @@ -1,11 +1,15 @@ { "exports": { ".": { - "browser": "./dynamic-import.js", + "browser": { + "import": "./dynamic-import.mjs", + "default": "./dynamic-import.js" + }, + "import": "./noop-for-node.mjs", "default": "./noop-for-node.js" } }, "main": "./noop-for-node.js", - "browser": "./dynamic-legacy-import.js", + "browser": "./dynamic-import.js", "types": "index.d.ts" } diff --git a/src/node_modules/@internal/model-viewer/dynamic-import.js b/src/node_modules/@internal/model-viewer/dynamic-import.js index 6eff15aed..f77959f8a 100644 --- a/src/node_modules/@internal/model-viewer/dynamic-import.js +++ b/src/node_modules/@internal/model-viewer/dynamic-import.js @@ -1,3 +1,5 @@ -export function load() { - return import("@google/model-viewer/dist/model-viewer.min.js"); -} +module.exports = { + load() { + return import("@google/model-viewer/dist/model-viewer.min.js"); + }, +}; diff --git a/src/node_modules/@internal/model-viewer/dynamic-import.mjs b/src/node_modules/@internal/model-viewer/dynamic-import.mjs new file mode 100644 index 000000000..6eff15aed --- /dev/null +++ b/src/node_modules/@internal/model-viewer/dynamic-import.mjs @@ -0,0 +1,3 @@ +export function load() { + return import("@google/model-viewer/dist/model-viewer.min.js"); +} diff --git a/src/node_modules/@internal/model-viewer/dynamic-legacy-import.js b/src/node_modules/@internal/model-viewer/dynamic-legacy-import.js deleted file mode 100644 index f77959f8a..000000000 --- a/src/node_modules/@internal/model-viewer/dynamic-legacy-import.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - load() { - return import("@google/model-viewer/dist/model-viewer.min.js"); - }, -}; diff --git a/src/node_modules/@internal/model-viewer/noop-for-node.mjs b/src/node_modules/@internal/model-viewer/noop-for-node.mjs new file mode 100644 index 000000000..524bdf9f6 --- /dev/null +++ b/src/node_modules/@internal/model-viewer/noop-for-node.mjs @@ -0,0 +1,3 @@ +export function load() { + return Promise.reject(); +}; diff --git a/src/node_modules/@internal/model-viewer/package.json b/src/node_modules/@internal/model-viewer/package.json index 4638d8c73..8f2a536a8 100644 --- a/src/node_modules/@internal/model-viewer/package.json +++ b/src/node_modules/@internal/model-viewer/package.json @@ -1,11 +1,15 @@ { "exports": { ".": { - "browser": "./dynamic-import.js", + "browser": { + "import": "./dynamic-import.mjs", + "default": "./dynamic-import.js" + }, + "import": "./noop-for-node.mjs", "default": "./noop-for-node.js" } }, "main": "./noop-for-node.js", - "browser": "./dynamic-legacy-import.js", + "browser": "./dynamic-import.js", "types": "index.d.ts" } diff --git a/src/node_modules/@internal/shaka-player/dynamic-import.js b/src/node_modules/@internal/shaka-player/dynamic-import.js index 8d4a95b27..78e40187b 100644 --- a/src/node_modules/@internal/shaka-player/dynamic-import.js +++ b/src/node_modules/@internal/shaka-player/dynamic-import.js @@ -1,3 +1,5 @@ -export function load() { - return import("shaka-player/dist/shaka-player.ui.js"); -} +module.exports = { + load() { + return import("shaka-player/dist/shaka-player.ui.js"); + }, +}; diff --git a/src/node_modules/@internal/shaka-player/dynamic-import.mjs b/src/node_modules/@internal/shaka-player/dynamic-import.mjs new file mode 100644 index 000000000..8d4a95b27 --- /dev/null +++ b/src/node_modules/@internal/shaka-player/dynamic-import.mjs @@ -0,0 +1,3 @@ +export function load() { + return import("shaka-player/dist/shaka-player.ui.js"); +} diff --git a/src/node_modules/@internal/shaka-player/dynamic-legacy-import.js b/src/node_modules/@internal/shaka-player/dynamic-legacy-import.js deleted file mode 100644 index 78e40187b..000000000 --- a/src/node_modules/@internal/shaka-player/dynamic-legacy-import.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - load() { - return import("shaka-player/dist/shaka-player.ui.js"); - }, -}; diff --git a/src/node_modules/@internal/shaka-player/noop-for-node.mjs b/src/node_modules/@internal/shaka-player/noop-for-node.mjs new file mode 100644 index 000000000..524bdf9f6 --- /dev/null +++ b/src/node_modules/@internal/shaka-player/noop-for-node.mjs @@ -0,0 +1,3 @@ +export function load() { + return Promise.reject(); +}; diff --git a/src/node_modules/@internal/shaka-player/package.json b/src/node_modules/@internal/shaka-player/package.json index 4638d8c73..8f2a536a8 100644 --- a/src/node_modules/@internal/shaka-player/package.json +++ b/src/node_modules/@internal/shaka-player/package.json @@ -1,11 +1,15 @@ { "exports": { ".": { - "browser": "./dynamic-import.js", + "browser": { + "import": "./dynamic-import.mjs", + "default": "./dynamic-import.js" + }, + "import": "./noop-for-node.mjs", "default": "./noop-for-node.js" } }, "main": "./noop-for-node.js", - "browser": "./dynamic-legacy-import.js", + "browser": "./dynamic-import.js", "types": "index.d.ts" }