1 | const createRollupPluginExternalGlobal = import.meta.require("rollup-plugin-external-globals")
|
2 |
|
3 | export const createImportFromGlobalRollupPlugin = ({ platformGlobalName }) => {
|
4 | if (typeof platformGlobalName !== "string")
|
5 | throw new TypeError(`platformGlobalName must be a string, got ${platformGlobalName}.`)
|
6 |
|
7 | return createRollupPluginExternalGlobal(
|
8 | {
|
9 | global: platformGlobalName,
|
10 | },
|
11 | {
|
12 | exclude: [/\.json$/],
|
13 | },
|
14 | )
|
15 | }
|