Front-End Assets
Introductionβ
Bow comes preconfigured with a modern Frontend environment based on Vite, including:
- React 19
- Vue.js 3
- Tailwind CSS 3
- Sass/SCSS
This setup provides instant reloading (HMR) and ultra-fast compilation.
Installationβ
npm install
Commandsβ
| Command | Description |
|---|---|
npm run dev | Starts the Vite development server with HMR |
npm run build | Compiles and optimizes for production |
Developmentβ
npm run dev
Starts the Vite server with hot reloading. Changes are reflected instantly without reloading the page.
Productionβ
npm run build
Compiles and minifies the assets into the public/ folder.
File Structureβ
assets/
βββ js/
β βββ app.js # Main entry point
β βββ Example.jsx # React component
β βββ Example.vue # Vue component
βββ sass/
β βββ app.scss # Main styles
β βββ variables.scss # SCSS variables
βββ css/
βββ app.css # CSS/Tailwind
Vite Configurationβ
vite.config.js
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import react from '@vitejs/plugin-react';
import path from 'path';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [
vue(),
react(),
tailwindcss(),
],
root: path.resolve(__dirname, 'assets'),
build: {
outDir: path.resolve(__dirname, 'public'),
emptyOutDir: true,
rollupOptions: {
input: {
app: path.resolve(__dirname, 'assets/js/app.js'),
},
output: {
entryFileNames: 'js/[name].js',
assetFileNames: (assetInfo) => {
if (/\.(css|scss)$/.test(assetInfo.name)) {
return 'css/[name]-[hash][extname]';
}
if (/\.(png|jpe?g|gif|svg|webp)$/.test(assetInfo.name)) {
return 'img/[name]-[hash][extname]';
}
return '[ext]/[name]-[hash][extname]';
},
},
},
},