Skip to content

Commit e2cfb8f

Browse files
authored
Merge pull request #258 from WalletConnect/fix/turbopack-build
fix: resolves turbopack build issue in nextjs
2 parents ba365de + 76d4c61 commit e2cfb8f

File tree

3 files changed

+61
-5
lines changed

3 files changed

+61
-5
lines changed

misc/logger/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@walletconnect/logger",
33
"description": "Logger Utils",
4-
"version": "3.0.0",
4+
"version": "3.0.1",
55
"author": "WalletConnect, Inc. <walletconnect.com>",
66
"license": "MIT",
77
"homepage": "https://github.com/WalletConnect/walletconnect-utils/",
@@ -28,6 +28,14 @@
2828
"browser": "dist/index.es.js",
2929
"unpkg": "dist/index.umd.js",
3030
"types": "dist/types/index.d.ts",
31+
"exports": {
32+
".": {
33+
"types": "./dist/types/index.d.ts",
34+
"import": "./dist/index.es.js",
35+
"require": "./dist/index.cjs.js",
36+
"default": "./dist/index.es.js"
37+
}
38+
},
3139
"scripts": {
3240
"clean": "rm -rf dist",
3341
"build:pre": "npm run clean",

misc/logger/rollup.config.js

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,52 @@
1-
import { name, dependencies } from "./package.json";
2-
import createConfig from "../../rollup.config";
1+
import esbuild from "rollup-plugin-esbuild";
2+
import { nodeResolve } from "@rollup/plugin-node-resolve";
3+
import commonjs from "@rollup/plugin-commonjs";
4+
import { name } from "./package.json";
35

4-
export default createConfig(name, Object.keys(dependencies || {}));
6+
const input = "./src/index.ts";
7+
8+
const plugins = [
9+
nodeResolve({ preferBuiltins: false, browser: true }),
10+
commonjs(),
11+
esbuild({
12+
minify: true,
13+
tsconfig: "./tsconfig.json",
14+
loaders: { ".json": "json" },
15+
}),
16+
];
17+
18+
export default [
19+
// UMD build (for script tags)
20+
{
21+
input,
22+
plugins,
23+
output: {
24+
file: "./dist/index.umd.js",
25+
format: "umd",
26+
exports: "named",
27+
name: name,
28+
sourcemap: true,
29+
},
30+
},
31+
// CJS/ESM builds (pino bundled)
32+
{
33+
input,
34+
plugins,
35+
output: [
36+
{
37+
file: "./dist/index.cjs.js",
38+
format: "cjs",
39+
exports: "named",
40+
name: name,
41+
sourcemap: true,
42+
},
43+
{
44+
file: "./dist/index.es.js",
45+
format: "es",
46+
exports: "named",
47+
name: name,
48+
sourcemap: true,
49+
},
50+
],
51+
},
52+
];

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)