@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.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/lib/plugin.d.ts +5 -0
- package/dist/lib/plugin.js +26 -0
- package/package.json +24 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -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
|
+
}
|