Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/sdk/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
],
"type": "module",
"exports": {
"types": "./dist/index.d.ts",
"types": "./dist/esm/src/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"main": "./dist/cjs/index.js",
"types": "./dist/index.d.ts",
"types": "./dist/esm/src/index.d.ts",
"files": [
"dist"
],
Expand Down Expand Up @@ -69,8 +69,6 @@
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"rollup": "^3.29.2",
"rollup-plugin-dts": "^6.0.2",
"rollup-plugin-esbuild": "^5.0.0",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-generate-package-json": "^3.2.0",
"ts-jest": "^29.1.0",
Expand Down
32 changes: 17 additions & 15 deletions packages/sdk/cloudflare/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import dts from 'rollup-plugin-dts';
import esbuild from 'rollup-plugin-esbuild';
import typescript from '@rollup/plugin-typescript';
import filesize from 'rollup-plugin-filesize';

const inputPath = 'src/index.ts';
const cjsPath = 'dist/cjs/index.js';
const esmPath = 'dist/esm/index.js';
const typingsPath = 'dist/index.d.ts';

const plugins = [resolve(), commonjs(), esbuild(), json(), terser(), filesize()];

// the second array item is a function to include all js-core packages in the bundle so they
// are not imported or required as separate npm packages
Expand All @@ -27,7 +23,14 @@ export default [
sourcemap: true,
},
],
plugins,
plugins: [
resolve(),
commonjs(),
typescript({ declaration: false, declarationMap: false }),
json(),
terser(),
filesize(),
],
external,
},
{
Expand All @@ -39,15 +42,14 @@ export default [
sourcemap: true,
},
],
plugins,
plugins: [
resolve(),
commonjs(),
typescript({ declaration: true, declarationDir: 'dist/esm' }),
json(),
terser(),
filesize(),
],
external,
},
{
input: inputPath,
plugins: [dts(), json()],
output: {
file: typingsPath,
format: 'esm',
},
},
];
Loading