@sleetch/vite 1.0.4

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.
@@ -0,0 +1,2 @@
1
+ import { plugin } from "./lib/plugin.js";
2
+ export { plugin as default };
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import { plugin } from "./lib/plugin.js";
2
+ //#region src/index.ts
3
+ var src_default = plugin;
4
+ //#endregion
5
+ export { src_default as default };
@@ -0,0 +1,5 @@
1
+ import { Plugin } from "vite";
2
+ //#region src/lib/plugin.d.ts
3
+ declare function plugin(): Plugin;
4
+ //#endregion
5
+ export { plugin };
@@ -0,0 +1,26 @@
1
+ import { sleetch_runtime } from "@sleetch/core/compiler";
2
+ //#region src/lib/plugin.ts
3
+ const runtime = new sleetch_runtime();
4
+ function plugin() {
5
+ return {
6
+ name: "sleetch",
7
+ enforce: "pre",
8
+ async buildStart() {
9
+ if (this.environment.mode === "build" && !runtime.sources.loaded()) {
10
+ console.log("buildStart", this.environment.name, this.environment.mode);
11
+ await runtime.sources.load();
12
+ await runtime.builder.build();
13
+ }
14
+ },
15
+ async configureServer(server) {
16
+ if (server.config.mode == "development") {
17
+ console.log("configServer", server.config.mode);
18
+ await runtime.sources.load();
19
+ await runtime.builder.build();
20
+ await runtime.sources.watch();
21
+ }
22
+ }
23
+ };
24
+ }
25
+ //#endregion
26
+ export { plugin };
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@sleetch/vite",
3
+ "version": "1.0.4",
4
+ "type": "module",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "scripts": {
12
+ "build": "tsdown",
13
+ "dev": "tsdown --watch"
14
+ },
15
+ "exports": {
16
+ ".": "./dist/index.js",
17
+ "./lib/plugin": "./dist/lib/plugin.js",
18
+ "./package.json": "./package.json"
19
+ },
20
+ "dependencies": {
21
+ "@sleetch/core": "1.0.4",
22
+ "vite": "^8.1.0"
23
+ }
24
+ }