@startupjs/vite-plugin-startupjs v0.54.2
@startupjs/vite-plugin-startupjs
Compile web client in development using vite
Installation
Install vite and this plugin
yarn add vite @startupjs/vite-plugin-startupjs
Add
vite.config.mjs
to the root of your project: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:
Run server with
-v
option:yarn server -v
Run web with
-v
option:yarn web -v
IMPORTANT things to follow when writing code:
You CAN NOT use
.js
/.ts
for files which haveJSX
(or use Pug). You MUST name them.jsx
/.tsx
.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 bepages/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.
7 months ago
7 months ago
7 months ago
9 months ago
6 months ago
7 months ago
7 months ago
7 months ago
11 months ago
12 months ago
1 year ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago