# @startupjs/vite-plugin-startupjs

> Vite plugin for startupjs

Latest version **0.54.2** (published 2023-11-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @startupjs/vite-plugin-startupjs
pnpm add @startupjs/vite-plugin-startupjs
yarn add @startupjs/vite-plugin-startupjs
bun add @startupjs/vite-plugin-startupjs
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.54.2 |
| Published | 2023-11-01 |
| First published | 2021-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 14 |
| Dependencies | 8 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | cray0000, yska, zag2art, fctsvirus, maestro.sc, byshock |

## Links

- npm: https://www.npmjs.com/package/@startupjs/vite-plugin-startupjs
- npm.io page: https://npm.io/package/@startupjs/vite-plugin-startupjs

## Dependencies (8)

- [@startupjs/bundler](https://npm.io/package/@startupjs/bundler.md) ^0.54.2
- [@vitejs/plugin-react](https://npm.io/package/@vitejs/plugin-react.md) ^1.0.6
- [@startupjs/babel-plugin-dotenv](https://npm.io/package/@startupjs/babel-plugin-dotenv.md) ^0.54.1
- [babel-plugin-transform-react-pug](https://npm.io/package/babel-plugin-transform-react-pug.md) ^7.0.1
- [@startupjs/babel-plugin-rn-stylename-inline](https://npm.io/package/@startupjs/babel-plugin-rn-stylename-inline.md) ^0.54.2
- [@startupjs/babel-plugin-import-to-react-lazy](https://npm.io/package/@startupjs/babel-plugin-import-to-react-lazy.md) ^0.54.1
- [@startupjs/babel-plugin-react-pug-classnames](https://npm.io/package/@startupjs/babel-plugin-react-pug-classnames.md) ^0.54.1
- [@startupjs/babel-plugin-rn-stylename-to-style](https://npm.io/package/@startupjs/babel-plugin-rn-stylename-to-style.md) ^0.54.2

## Recent versions

- 0.54.2 (latest) — 2023-11-01
- 0.55.0-alpha.11 (next) — 2023-11-15
- 0.55.0-alpha.1 — 2023-11-08
- 0.55.0-alpha.0 — 2023-11-07
- 0.54.1 — 2023-11-01
- 0.54.0 — 2023-10-25
- 0.53.3 — 2023-10-19
- 0.53.0 — 2023-08-17
- 0.52.3 — 2023-06-26
- 0.52.1 — 2023-05-31
- 0.52.0 — 2023-05-26
- 0.52.0-alpha.0 — 2023-05-26
- 0.51.0 — 2023-05-24
- 0.50.23 — 2023-05-18
- 0.50.13 — 2023-02-27
- … 38 more at https://npm.io/package/@startupjs/vite-plugin-startupjs/versions

## README

# @startupjs/vite-plugin-startupjs

> Compile web client in development using vite

## Installation

1. Install vite and this plugin

    ```
    yarn add vite @startupjs/vite-plugin-startupjs
    ```

2. Add `vite.config.mjs` to the root of your project:

    ```js
    import { defineConfig } from 'vite'
    import startupjsPlugin from '@startupjs/vite-plugin-startupjs'

    // https://vitejs.dev/config/
    export default defineConfig({
      plugins: [
        startupjsPlugin()
      ]
    })
    ```

## Usage

Run server and web compilation together:

```
yarn start -v
```

If you want to run server and web compilation separately:

1. Run server with `-v` option:

    ```
    yarn server -v
    ```

2. Run web with `-v` option:

    ```
    yarn web -v
    ```

## **IMPORTANT** things to follow when writing code:

1. You **CAN NOT** use `.js`/`.ts` for files which have `JSX` (or use Pug). You **MUST** name them `.jsx`/`.tsx`.

2. To leverage Vite's power of compiling only the pages you currently look at, you have to be using async imports on the router level.

    Make sure that `pages/index.jsx` (it might also be `pages/index.js`) in all of your apps have the following comment specified at the top of the file:

    ```
    /* @asyncImports */
    ```

    This will automatically transform all imports in this file into react lazy async imports.

---
_Source: https://npm.io/package/@startupjs/vite-plugin-startupjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
