Skip to content
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ vite.config.js.timestamp-*
vite.config.ts.timestamp-*

.angular
.nitro
1 change: 1 addition & 0 deletions examples/react/drizzle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"dev": "drizzle-kit studio & vite dev",
"build": "vite build",
"start": "vite start"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
"size-limit": [
{
"path": "packages/devtools/dist/esm/index.js",
"path": "packages/devtools/dist/index.js",
"limit": "40 KB"
},
{
Expand Down
30 changes: 21 additions & 9 deletions packages/devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,26 @@
"devtools"
],
"type": "module",
"types": "dist/esm/index.d.ts",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
}
"node": {
"types": "./dist/index.d.ts",
"import": "./dist/server.js"
},
"./package.json": "./package.json"
"browser": {
"development": {
"types": "./dist/index.d.ts",
"import": "./dist/dev.js"
},
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"types": "./dist/index.d.ts",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"sideEffects": false,
"engines": {
Expand All @@ -45,7 +55,7 @@
"test:lib:dev": "pnpm test:lib --watch",
"test:types": "tsc",
"test:build": "publint --strict",
"build": "vite build"
"build": "tsup"
},
"dependencies": {
"@solid-primitives/keyboard": "^1.2.8",
Expand All @@ -60,6 +70,8 @@
"solid-js": ">=1.9.7"
},
"devDependencies": {
"tsup": "^8.5.0",
"tsup-preset-solid": "^2.2.0",
"vite-plugin-solid": "^2.11.6"
}
}
2 changes: 2 additions & 0 deletions packages/devtools/src/core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export class TanStackDevtoolsCore {
}

mount<T extends HTMLElement>(el: T) {
// tsup-preset-solid statically replaces this variable during build, which eliminates this code from server bundle
if (import.meta.env.SSR) return
if (this.#isMounted) {
throw new Error('Devtools is already mounted')
}
Expand Down
1 change: 0 additions & 1 deletion packages/devtools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"compilerOptions": {
"jsxImportSource": "solid-js",
"jsx": "preserve",

"types": ["vite/client"]
}
}
19 changes: 19 additions & 0 deletions packages/devtools/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from 'tsup'
import { generateTsupOptions, parsePresetOptions } from 'tsup-preset-solid'

const preset_options = {
entries: {
entry: 'src/index.ts',
dev_entry: true,
server_entry: true,
},
cjs: false,
drop_console: true,
}

export default defineConfig(() => {
const parsed_data = parsePresetOptions(preset_options)
const tsup_options = generateTsupOptions(parsed_data)

return tsup_options
})
Loading