Skip to content

Commit

Permalink
fix: fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cmartinho committed Mar 12, 2024
1 parent 9a377af commit 9395d7e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 53 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-pumas-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shadeprotocol/shadejs": minor
---

Fix installation issues on client side
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"license": "MIT",
"type": "module",
"main": "./dist/shadejs.cjs",
"module": "./dist/shadejs.js",
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/shadejs.js",
"require": "./dist/shadejs.cjs"
"import": "./dist/index.js",
"require": "./dist/index.umd.cjs"
}
},
"files": [
Expand Down
5 changes: 0 additions & 5 deletions src/polyfills/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import 'whatwg-fetch';

if (typeof window === 'undefined') {
// @ts-ignore
global.window = globalThis;
}
19 changes: 15 additions & 4 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
import { defineConfig } from 'vite';
import path from 'path';
// eslint-disable-next-line import/no-extraneous-dependencies
import dts from 'vite-plugin-dts';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

// https://vitejs.dev/config/
export default defineConfig({
// @ts-ignore
// vitest configs
test: {
globals: true,
},

resolve: {
alias: {
'~': `${path.resolve(__dirname, 'src')}`,
},
},

build: {
manifest: true,
minify: true,
reportCompressedSize: true,
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'index',
formats: ['es', 'cjs'],
name: 'shadejs',
fileName: 'index',
},
},
plugins: [dts({ rollupTypes: true })],
plugins: [
dts({ rollupTypes: true }),
nodePolyfills({
include: ['path', 'buffer'],
globals: {
Buffer: true,
},
}),
],
});
40 changes: 0 additions & 40 deletions vite.config.ts

This file was deleted.

0 comments on commit 9395d7e

Please sign in to comment.