@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-startupjsAdd
vite.config.mjsto 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 -vIf you want to run server and web compilation separately:
Run server with
-voption:yarn server -vRun web with
-voption:yarn web -v
IMPORTANT things to follow when writing code:
You CAN NOT use
.js/.tsfor 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.
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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago