Skip to content

Commit

Permalink
fix: adds explicit RN config for rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
Gancho Radkov committed Nov 15, 2023
1 parent 17ff53f commit 402dcd4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions misc/keyvaluestorage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"browser": "dist/index.es.js",
"unpkg": "dist/index.umd.js",
"types": "dist/types/index.d.ts",
"react-native": "dist/react-native/index.js",
"homepage": "https://github.com/walletconnect/walletconnect-utils",
"repository": {
"type": "git",
Expand Down
18 changes: 14 additions & 4 deletions misc/keyvaluestorage/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { name, dependencies } from "./package.json";

const input = "./src/index.ts";
const browserInput = "./src/browser/index.ts";
const reactNativeInput = "./src/react-native/index.ts";
const plugins = [
nodeResolve({ preferBuiltins: false, browser: true }),
commonjs(),
Expand All @@ -20,7 +21,7 @@ const plugins = [

export default createConfig(name, Object.keys(dependencies || {}));

function createConfig(packageName, packageDependencies, umd = {}, cjs = {}, es = {}) {
function createConfig(packageName, packageDependencies) {
return [
{
input,
Expand All @@ -31,7 +32,6 @@ function createConfig(packageName, packageDependencies, umd = {}, cjs = {}, es =
exports: "named",
name: packageName,
sourcemap: true,
...umd,
},
},
{
Expand All @@ -44,7 +44,6 @@ function createConfig(packageName, packageDependencies, umd = {}, cjs = {}, es =
exports: "named",
name: packageName,
sourcemap: true,
...cjs,
},
},
{
Expand All @@ -57,7 +56,18 @@ function createConfig(packageName, packageDependencies, umd = {}, cjs = {}, es =
exports: "named",
name: packageName,
sourcemap: true,
...es,
},
},
{
input: reactNativeInput,
plugins,
external: [/node_modules/],
output: {
file: "./dist/react-native/index.js",
format: "cjs",
exports: "named",
name: packageName,
sourcemap: true,
},
},
];
Expand Down

0 comments on commit 402dcd4

Please sign in to comment.