Skip to content

Commit

Permalink
feat!: remove default exports
Browse files Browse the repository at this point in the history
  • Loading branch information
cyco130 committed Sep 25, 2023
1 parent 9e15ee3 commit b6e9b0d
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 31 deletions.
2 changes: 1 addition & 1 deletion examples/express/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/fastify-vite-plugin-ssr/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import ssr from "vite-plugin-ssr/plugin";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
buildSteps: [
Expand Down
2 changes: 1 addition & 1 deletion examples/fastify/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
plugins: [vavite({ handlerEntry: "/handler.ts" })],
Expand Down
2 changes: 1 addition & 1 deletion examples/hapi/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/koa/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/nestjs-vite-plugin-ssr/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";
import { swc } from "rollup-plugin-swc3";
import react from "@vitejs/plugin-react";
import ssr from "vite-plugin-ssr/plugin";
Expand Down
2 changes: 1 addition & 1 deletion examples/nestjs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";
import { swc } from "rollup-plugin-swc3";

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-standalone/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
plugins: [vavite({ handlerEntry: "/handler.ts" })],
Expand Down
2 changes: 1 addition & 1 deletion examples/socket-io/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/ssr-react-express/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";
import react from "@vitejs/plugin-react";

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion examples/ssr-vue-express/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";
import vue from "@vitejs/plugin-vue";

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-plugin-ssr/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import ssr from "vite-plugin-ssr/plugin";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
buildSteps: [
Expand Down
2 changes: 1 addition & 1 deletion packages/connect/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Install `vite` and `@vavite/connect` as development dependencies (`npm install -

```ts
import { defineConfig } from "vite";
import vaviteConnect from "@vavite/connect";
import { vaviteConnect } from "@vavite/connect";

export default defineConfig({
plugins: [
Expand Down
4 changes: 1 addition & 3 deletions packages/connect/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export interface VaviteConnectOptions {
bundleSirv?: boolean;
}

export default function vaviteConnect(
options: VaviteConnectOptions = {},
): Plugin[] {
export function vaviteConnect(options: VaviteConnectOptions = {}): Plugin[] {
const {
handlerEntry = "/handler",
customServerEntry,
Expand Down
2 changes: 1 addition & 1 deletion packages/multibuild-cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BuildOptions, LogLevel, ResolvedConfig } from "vite";
import { cac } from "cac";
import multibuild from "@vavite/multibuild";
import { multibuild } from "@vavite/multibuild";
import { version } from "../package.json";
import colors from "picocolors";

Expand Down
2 changes: 1 addition & 1 deletion packages/multibuild/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default defineConfig({
});
```

You can then `import multibuild from "@vavite/multibuild"` and use it instead of Vite's `build` function to run a multi-step build.
You can then `import { multibuild } from "@vavite/multibuild"` and use it instead of Vite's `build` function to run a multi-step build.

`@vavite/multibuild` will call `resolveConfig` with the `mode` parameter set to `"multibuild"` to extract the build steps. Setting `buildSteps` in subsequent steps has no effect.

Expand Down
2 changes: 1 addition & 1 deletion packages/multibuild/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface MultibuildOptions {
onStartBuildStep?(info: VaviteMultiBuildInfo): void | Promise<void>;
}

export default async function multibuild(
export async function multibuild(
config: InlineConfig = {},
options: MultibuildOptions = {},
) {
Expand Down
4 changes: 2 additions & 2 deletions packages/reloader/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Install `vite` and `@vavite/reloader` as development dependencies (`npm install

```ts
import { defineConfig } from "vite";
import vaviteReloader from "@vavite/reloader";
import { reloader } from "@vavite/reloader";

export default defineConfig({
plugins: [
vaviteReloader({
reloader({
// Options, see below
}),
],
Expand Down
2 changes: 1 addition & 1 deletion packages/reloader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface VaviteReloaderOptions {
serveClientAssetsInDev?: boolean;
}

export default function vaviteReloaderPlugin({
export function reloader({
entry = "/server",
reloadOn = "any-change",
serveClientAssetsInDev = false,
Expand Down
2 changes: 0 additions & 2 deletions packages/vavite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"version": "2.0.2",
"description": "A Vite plugin for develoing server-side applications",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"files": [
"dist",
"*.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/vavite/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Install `vite` and `vavite` as development dependencies (`npm install --save-dev

```ts
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
plugins: [
Expand Down Expand Up @@ -145,7 +145,7 @@ Developing applications that perform server-side rendering (SSR) with Vite requi

```ts
import { defineConfig } from "vite";
import vavite from "vavite";
import { vavite } from "vavite";

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion packages/vavite/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
version as viteVersion,
} from "vite";
import { cac } from "cac";
import multibuild from "@vavite/multibuild";
import { multibuild } from "@vavite/multibuild";
import { version } from "../package.json";
import pico from "picocolors";
import { spawn } from "node:child_process";
Expand Down
8 changes: 4 additions & 4 deletions packages/vavite/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Plugin, PluginOption, UserConfig } from "vite";
import vaviteConnect from "@vavite/connect";
import vaviteReloader from "@vavite/reloader";
import { vaviteConnect } from "@vavite/connect";
import { reloader } from "@vavite/reloader";
import vaviteExposeViteDevServer from "@vavite/expose-vite-dev-server";
import { nodeLoaderPlugin } from "@vavite/node-loader/plugin";

Expand Down Expand Up @@ -51,7 +51,7 @@ export interface VaviteOptions {
reloadOn?: "any-change" | "static-deps-change";
}

export default function vavite(options: VaviteOptions): PluginOption {
export function vavite(options: VaviteOptions): PluginOption {
const {
serverEntry,
handlerEntry,
Expand Down Expand Up @@ -120,7 +120,7 @@ export default function vavite(options: VaviteOptions): PluginOption {
);
} else {
plugins.push(
vaviteReloader({
reloader({
entry: serverEntry,
serveClientAssetsInDev,
reloadOn,
Expand Down

0 comments on commit b6e9b0d

Please sign in to comment.