solid-optimizer 0.2.0 → 0.4.0
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.
- package/README.md +294 -14
- package/dist/compile-BQuBDA0Q.d.mts +199 -0
- package/dist/compile-BQuBDA0Q.d.mts.map +1 -0
- package/dist/compile-D3caSUtw.mjs +4244 -0
- package/dist/compile-D3caSUtw.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +2 -0
- package/dist/vite.d.mts +53 -0
- package/dist/vite.d.mts.map +1 -0
- package/dist/vite.mjs +1743 -0
- package/dist/vite.mjs.map +1 -0
- package/package.json +60 -58
- package/src/ast.ts +271 -0
- package/src/compile.ts +355 -0
- package/src/constants.ts +249 -0
- package/src/context.ts +116 -0
- package/src/fold.ts +850 -0
- package/src/index.ts +5 -107
- package/src/inline.ts +2237 -0
- package/src/jsx.ts +170 -0
- package/src/memo.ts +416 -0
- package/src/provider.ts +899 -0
- package/src/scope.ts +588 -0
- package/src/server.ts +275 -0
- package/src/size.ts +309 -0
- package/src/value.ts +386 -0
- package/src/vite/index.ts +1378 -0
- package/src/vite/inject.ts +350 -0
- package/src/vite/namespace.ts +66 -0
- package/src/vite/refs.ts +99 -0
- package/src/vite/report.ts +74 -0
- package/src/vite/runtime.ts +370 -0
- package/src/vite/usage.ts +405 -0
- package/dist/cjs/development/index.cjs +0 -228
- package/dist/cjs/development/index.cjs.map +0 -7
- package/dist/cjs/production/index.cjs +0 -1
- package/dist/esm/development/index.mjs +0 -197
- package/dist/esm/development/index.mjs.map +0 -7
- package/dist/esm/production/index.mjs +0 -1
- package/dist/types/checks.d.ts +0 -9
- package/dist/types/checks.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/path-references-import.d.ts +0 -3
- package/dist/types/path-references-import.d.ts.map +0 -1
- package/dist/types/unwrap-node.d.ts +0 -7
- package/dist/types/unwrap-node.d.ts.map +0 -1
- package/dist/types/unwrap-path.d.ts +0 -6
- package/dist/types/unwrap-path.d.ts.map +0 -1
- package/src/checks.ts +0 -42
- package/src/path-references-import.ts +0 -82
- package/src/unwrap-node.ts +0 -27
- package/src/unwrap-path.ts +0 -18
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as readModuleConstants, c as Skip, i as compile, l as SkipPass, n as CompileResult, o as ImportedConstants, r as ModuleConstants, s as Primitive, t as CompileOptions } from "./compile-BQuBDA0Q.mjs";
|
|
2
|
+
export { type CompileOptions, type CompileResult, type ImportedConstants, type ModuleConstants, type Primitive, type Skip, type SkipPass, compile, readModuleConstants };
|
package/dist/index.mjs
ADDED
package/dist/vite.d.mts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { c as Skip, t as CompileOptions } from "./compile-BQuBDA0Q.mjs";
|
|
2
|
+
import { Plugin } from "vite";
|
|
3
|
+
import { Options as Options$1 } from "vite-plugin-solid";
|
|
4
|
+
//#region src/vite/report.d.ts
|
|
5
|
+
/** What the optimizer left alone in one build environment. */
|
|
6
|
+
interface OptimizerReport {
|
|
7
|
+
/** The Vite environment, like `client` or `ssr`. */
|
|
8
|
+
readonly environment: string;
|
|
9
|
+
readonly skips: readonly Skip[];
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/vite/index.d.ts
|
|
13
|
+
export interface OptimizerOptions extends Pick<CompileOptions, 'fold' | 'inline' | 'alwaysInline' | 'contexts' | 'memos' | 'maxPasses'> {
|
|
14
|
+
/**
|
|
15
|
+
* Reduce Solid's reactive primitives to what they do on the server, in
|
|
16
|
+
* server builds. See the `server` option of `compile`.
|
|
17
|
+
*
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
server?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Where the optimizer runs.
|
|
23
|
+
*
|
|
24
|
+
* - `auto` uses chunk mode for client builds that do not hydrate, and module mode otherwise.
|
|
25
|
+
* - `module` optimizes each module on its own.
|
|
26
|
+
*
|
|
27
|
+
* @default 'auto'
|
|
28
|
+
*/
|
|
29
|
+
mode?: 'auto' | 'module';
|
|
30
|
+
/**
|
|
31
|
+
* Also optimize while serving, in module mode.
|
|
32
|
+
*
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
dev?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Report what the optimizer leaves alone in each build, and why: each
|
|
38
|
+
* component call that stays a call, each provider that stays, and each
|
|
39
|
+
* memo that stays. `true` prints the report. A function receives it
|
|
40
|
+
* instead, once per build environment.
|
|
41
|
+
*
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
report?: boolean | ((report: OptimizerReport) => void);
|
|
45
|
+
}
|
|
46
|
+
export interface Options extends Partial<Options$1> {
|
|
47
|
+
/** Set to `false` to use `vite-plugin-solid` as it is. */
|
|
48
|
+
optimizer?: OptimizerOptions | false;
|
|
49
|
+
}
|
|
50
|
+
export default function solidOptimizer(options?: Options): Plugin[];
|
|
51
|
+
//#endregion
|
|
52
|
+
export type { OptimizerReport };
|
|
53
|
+
//# sourceMappingURL=vite.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.d.mts","names":["SolidPluginOptions"],"sources":["../src/vite/report.ts","../src/vite/index.ts"],"mappings":";;;;;UAUiB;;WAEN;WACA,gBAAgB;;;;iBCsCV,yBAAyB,KACxC;;;;;;;EASA;;;;;;;;;EASA;;;;;;EAMA;;;;;;;;;EASA,qBAAqB,QAAQ;;iBAKd,gBAAgB,QAAQA;;EAEvC,YAAY;;wBAmOU,eAAe,UAAS,UAAe"}
|