vite-plugin-kiru 0.29.0 → 0.29.1
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/build.dev.ts +1 -1
- package/dist/index.js +26 -3
- package/package.json +1 -1
package/build.dev.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2344,8 +2344,6 @@ function createViteConfig(config, opts) {
|
|
|
2344
2344
|
...config.build,
|
|
2345
2345
|
ssr,
|
|
2346
2346
|
manifest: "vite-manifest.json",
|
|
2347
|
-
ssrEmitAssets: true,
|
|
2348
|
-
ssrManifest: true,
|
|
2349
2347
|
outDir: desiredOutDir,
|
|
2350
2348
|
rollupOptions: {
|
|
2351
2349
|
...rollup,
|
|
@@ -4760,13 +4758,16 @@ function shouldTransformFile(id, state) {
|
|
|
4760
4758
|
}
|
|
4761
4759
|
|
|
4762
4760
|
// src/index.ts
|
|
4761
|
+
import { build } from "vite";
|
|
4763
4762
|
function kiru(opts = {}) {
|
|
4764
4763
|
let state;
|
|
4765
4764
|
let log;
|
|
4766
4765
|
let virtualModules = {};
|
|
4767
|
-
|
|
4766
|
+
let inlineConfig;
|
|
4767
|
+
const mainPlugin = {
|
|
4768
4768
|
name: "vite-plugin-kiru",
|
|
4769
4769
|
config(config) {
|
|
4770
|
+
inlineConfig = config;
|
|
4770
4771
|
return createViteConfig(config, opts);
|
|
4771
4772
|
},
|
|
4772
4773
|
configResolved(config) {
|
|
@@ -4906,6 +4907,28 @@ function kiru(opts = {}) {
|
|
|
4906
4907
|
};
|
|
4907
4908
|
}
|
|
4908
4909
|
};
|
|
4910
|
+
return [
|
|
4911
|
+
mainPlugin,
|
|
4912
|
+
{
|
|
4913
|
+
name: "vite-plugin-kiru:ssg",
|
|
4914
|
+
apply: "build",
|
|
4915
|
+
enforce: "post",
|
|
4916
|
+
async closeBundle(error) {
|
|
4917
|
+
if (error || this.environment.config.build.ssr || !state.ssgOptions)
|
|
4918
|
+
return;
|
|
4919
|
+
log(ANSI.cyan("[SSG]"), "Starting SSG build...");
|
|
4920
|
+
await build({
|
|
4921
|
+
...inlineConfig,
|
|
4922
|
+
configFile: false,
|
|
4923
|
+
build: {
|
|
4924
|
+
...inlineConfig?.build,
|
|
4925
|
+
ssr: true
|
|
4926
|
+
}
|
|
4927
|
+
});
|
|
4928
|
+
log(ANSI.cyan("[SSG]"), "SSG build complete!");
|
|
4929
|
+
}
|
|
4930
|
+
}
|
|
4931
|
+
];
|
|
4909
4932
|
}
|
|
4910
4933
|
function onHMR(callback) {
|
|
4911
4934
|
}
|