@kiln-js/vite-plugin 0.1.3 → 0.1.5

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 CHANGED
@@ -1,6 +1,14 @@
1
1
  import type { PluginOption } from "vite";
2
+ export interface KilnPlugin {
3
+ name: string;
4
+ vite?: () => PluginOption[];
5
+ }
6
+ export interface KilnConfig {
7
+ plugins?: KilnPlugin[];
8
+ }
2
9
  export interface KilnOptions {
3
10
  pagesDir?: string;
4
11
  apiDir?: string;
5
12
  }
13
+ export declare function defineConfig<T extends KilnConfig>(config: T): T;
6
14
  export declare function kiln(opts?: KilnOptions): PluginOption[];
package/dist/index.js CHANGED
@@ -13,15 +13,15 @@ globalThis.__KILN_API__ = __kilnApi;
13
13
  var TITLE_IMPORT = `import { Title as KilnTitle } from "@kiln-js/core";
14
14
  `;
15
15
  var norm = (p) => p.replace(/\\/g, "/");
16
+ function defineConfig(config) {
17
+ return config;
18
+ }
16
19
  function routesPlugin(pagesDir, apiDir) {
17
20
  const pagesPrefix = norm(pagesDir) + "/";
18
21
  const apiPrefix = norm(apiDir) + "/";
19
22
  return {
20
23
  name: "kiln:routes",
21
24
  enforce: "pre",
22
- config() {
23
- return { envPrefix: ["VITE_", "KILN_PUBLIC_"] };
24
- },
25
25
  resolveId(source, _importer, options) {
26
26
  if (source === VIRTUAL)
27
27
  return RESOLVED;
@@ -83,5 +83,6 @@ function kiln(opts = {}) {
83
83
  return [react(), routesPlugin(pagesDir, apiDir)];
84
84
  }
85
85
  export {
86
+ defineConfig,
86
87
  kiln
87
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiln-js/vite-plugin",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -16,7 +16,7 @@
16
16
  "typecheck": "tsc -p tsconfig.json --noEmit"
17
17
  },
18
18
  "dependencies": {
19
- "@kiln-js/core": "^0.1.3",
19
+ "@kiln-js/core": "^0.1.4",
20
20
  "@vitejs/plugin-react": "^4.3.0"
21
21
  },
22
22
  "peerDependencies": {