Skip to content

Instantly share code, notes, and snippets.

@pxlrbt
Created January 5, 2023 05:50
Show Gist options
  • Save pxlrbt/8aa1c5ce349abf7d9d8bc3346df82b7b to your computer and use it in GitHub Desktop.
Save pxlrbt/8aa1c5ce349abf7d9d8bc3346df82b7b to your computer and use it in GitHub Desktop.
Kirby Vite
composer require oblik/kirby-vite
npm i
{
"devDependencies": {
"vite": "^4.0.4"
},
"scripts": {
"dev": "rm -rf dist && vite",
"build": "vite build"
},
"dependencies": {
"sass": "^1.57.1",
"vite-plugin-live-reload": "^3.0.1"
}
}
import { defineConfig } from 'vite'
import path from 'path';
import liveReload from 'vite-plugin-live-reload'
let reloadDirs = [
'content/**/*.txt',
'site/(templates|snippets|controllers|models|plugins)/**/*.php',
]
export default ({ mode }) => defineConfig({
plugins: [
liveReload(reloadDirs)
],
server: {
host: path.basename(__dirname) + '.test'
},
// config
// base: mode === 'development' ? '/' : '/dist',
build: {
// output dir for production build
outDir: './dist',
// emit manifest so PHP can find the hashed files
manifest: true,
// our entry
rollupOptions: {
input: 'assets/js/main.js',
},
resolve: {
alias: {
'@': '/assets/js/components',
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment