@solidjs/vite-plugin 3.0.0-next.30 → 3.0.0-next.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,7 @@ export type DevStyleSource = {
23
23
  id: string;
24
24
  url: string;
25
25
  };
26
+ export type DevStyleFilter = (id: string) => boolean;
26
27
  export type ResolvedAssets = {
27
28
  js: string[];
28
29
  css: (string | DevStyleDescriptor)[];
@@ -98,7 +99,7 @@ export declare function devManifestBridgeUrl(server: ViteDevServer): string | nu
98
99
  */
99
100
  export declare const devStylePatch: string;
100
101
  /** Discovers ambient CSS in an entry graph without choosing how it is transported. */
101
- export declare function collectDevStyleSources(env: DevEnvironment, files: string[], onFile?: (file: string) => void): Promise<DevStyleSource[]>;
102
+ export declare function collectDevStyleSources(env: DevEnvironment, files: string[], onFile?: (file: string) => void, filter?: DevStyleFilter): Promise<DevStyleSource[]>;
102
103
  /**
103
104
  * Walks the SSR module graph from `files` (root-relative or absolute) and
104
105
  * returns inline-style descriptors for every transitively imported CSS
@@ -107,7 +108,7 @@ export declare function collectDevStyleSources(env: DevEnvironment, files: strin
107
108
  * CSS into `<head>` so server-painted content is styled from the first byte
108
109
  * (no FOUC while waiting for Vite's client-side style injection).
109
110
  */
110
- export declare function collectDevStyles(server: ViteDevServer, files: string[]): Promise<DevStyleDescriptor[]>;
111
+ export declare function collectDevStyles(server: ViteDevServer, files: string[], filter?: DevStyleFilter): Promise<DevStyleDescriptor[]>;
111
112
  /**
112
113
  * Serializes a dev style descriptor to the exact tag shape the SSR runtime
113
114
  * emits for lazy-registered assets (`data-asset` marks the SSR'd copy so
@@ -125,4 +126,4 @@ export declare function renderDevStyleTag(desc: DevStyleDescriptor): string;
125
126
  * `devManifestCode` (src/index.ts) — keep the two in sync.
126
127
  */
127
128
  export declare function devModuleUrl(root: string, base: string, key: string): string;
128
- export declare function createDevAssetResolver(server: ViteDevServer): DevAssetResolver;
129
+ export declare function createDevAssetResolver(server: ViteDevServer, filter?: DevStyleFilter): DevAssetResolver;
@@ -0,0 +1,3 @@
1
+ export declare const DEVTOOLS_PACKAGE = "@solidjs/start-devtools";
2
+ export declare const DEVTOOLS_MOUNT_ID = "virtual:solid-devtools/mount";
3
+ export declare function devtoolsMountModuleCode(): string;
@@ -1,3 +1,4 @@
1
+ import type { RunnableDevEnvironment } from 'vite';
1
2
  /**
2
3
  * Cross-instance-safe stand-in for vite's `isRunnableDevEnvironment`.
3
4
  *
@@ -10,4 +11,7 @@
10
11
  * member (`RunnableDevEnvironment` is exactly "a DevEnvironment with a
11
12
  * runner"), so presence-check it instead of trusting class identity.
12
13
  */
13
- export declare function isRunnableEnvironment(environment: unknown): boolean;
14
+ export declare function isRunnableEnvironment(environment: unknown): environment is RunnableDevEnvironment;
15
+ export declare function getEnvironmentConsumer(environment: unknown, options?: {
16
+ ssr?: boolean;
17
+ }): 'client' | 'server';
@@ -1,4 +1,5 @@
1
- import { type Plugin } from 'vite';
1
+ import { type FilterPattern, type Plugin } from 'vite';
2
+ import { type DevStyleFilter } from '../dev-manifest.js';
2
3
  /**
3
4
  * Options for the main plugin's `start` option (`start: true` is
4
5
  * sugar for the empty bag). One bag serves both modes — the plugin's `ssr`
@@ -16,6 +17,29 @@ export interface StartOptions {
16
17
  * @default "src/App.{tsx,jsx,ts,js}" (also probes lowercase "src/app.*")
17
18
  */
18
19
  app?: string;
20
+ /** Options for development CSS crawling. */
21
+ css?: {
22
+ /**
23
+ * Filter for the modules traversed while collecting the CSS that dev
24
+ * SSR inlines into `<head>`. Patterns are
25
+ * [picomatch](https://github.com/micromatch/picomatch) globs or regexes;
26
+ * relative globs resolve against the Vite root. CSS files themselves
27
+ * and virtual modules always pass — the filter decides which module
28
+ * graphs are crawled, not which stylesheets are kept.
29
+ *
30
+ * `exclude` prunes matching graphs and defaults to `/node_modules/`
31
+ * (providing your own replaces the default). `include` opts matching
32
+ * files back in on top of that baseline — typically a package whose
33
+ * CSS should be server-inlined to avoid a development FOUC, e.g.
34
+ * `{ include: /node_modules\/some-ui-lib/ }`. A file matching both
35
+ * stays excluded. Development only: production CSS always comes from
36
+ * the built assets.
37
+ */
38
+ filter?: {
39
+ include?: FilterPattern;
40
+ exclude?: FilterPattern;
41
+ };
42
+ };
19
43
  /**
20
44
  * Server entry module. Must export `render(request?, context?)` returning
21
45
  * a `renderToStream` result, an HTML string, or a `Response`.
@@ -132,6 +156,22 @@ export interface StartOptions {
132
156
  * @default undefined (probe env.ts / env.js; off when absent)
133
157
  */
134
158
  env?: boolean | string;
159
+ /**
160
+ * Enable the development toolbar. By default it is enabled when
161
+ * `@solidjs/start-devtools` is installed. Setting this to `true` requires
162
+ * the package, while `false` disables it.
163
+ *
164
+ * @default undefined
165
+ */
166
+ devtools?: boolean;
167
+ /**
168
+ * Add the default production error boundary to generated entries.
169
+ * Disable this when application middleware owns error handling. Authored
170
+ * entries are unaffected.
171
+ *
172
+ * @default true
173
+ */
174
+ errorBoundary?: boolean;
135
175
  /**
136
176
  * Let a host integration own the server environment — build wiring and
137
177
  * HTTP serving alike. The plugin skips its start-mode server-build config and
@@ -164,4 +204,5 @@ export declare function startServe(options: StartOptions, internal?: {
164
204
  serverFunctions?: boolean;
165
205
  serverComponents?: boolean;
166
206
  ssr?: boolean;
207
+ styleFilter?: DevStyleFilter;
167
208
  }): Plugin[];
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@solidjs/vite-plugin",
3
- "version": "3.0.0-next.30",
4
- "description": "solid-js integration plugin for vite 6/7/8",
3
+ "version": "3.0.0-next.32",
4
+ "description": "solid-js integration plugin for Vite",
5
5
  "type": "module",
6
+ "engines": {
7
+ "node": "^20.19.0 || >=22.12.0"
8
+ },
6
9
  "files": [
7
10
  "dist",
8
11
  "virtual-solid-manifest.d.ts",
@@ -64,7 +67,8 @@
64
67
  "@rollup/plugin-commonjs": "^25.0.7",
65
68
  "@rollup/plugin-node-resolve": "^15.2.3",
66
69
  "@skypack/package-check": "^0.2.2",
67
- "@types/node": "^18.18.4",
70
+ "@solidjs/start-devtools": "^1.0.0-next.3",
71
+ "@types/node": "^24.0.0",
68
72
  "cypress": "^14.0.0",
69
73
  "cypress-visual-regression": "^5.2.2",
70
74
  "cypress-vite": "^1.6.0",
@@ -74,15 +78,19 @@
74
78
  "rollup-plugin-cleaner": "^1.0.0",
75
79
  "solid-js": "^2.0.0-rc.0",
76
80
  "typescript": "^5.2.2",
77
- "vite": "^7.0.0"
81
+ "vite": "^8.2.1"
78
82
  },
79
83
  "peerDependencies": {
84
+ "@solidjs/start-devtools": "^1.0.0-next.2",
80
85
  "@solidjs/web": "^2.0.0-rc.0",
81
86
  "@testing-library/jest-dom": "^5.16.6 || ^5.17.0 || ^6.*",
82
87
  "solid-js": "^2.0.0-rc.0",
83
- "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
88
+ "vite": "^8.0.0 || ^9.0.0"
84
89
  },
85
90
  "peerDependenciesMeta": {
91
+ "@solidjs/start-devtools": {
92
+ "optional": true
93
+ },
86
94
  "@testing-library/jest-dom": {
87
95
  "optional": true
88
96
  }