Files
liveview/frontend/rollup.config.js
Andros Fenollosa 2ef147801c Add keyboard events support to LiveView
- Add data-liveview-keyboard-map attribute to map keyboard shortcuts to handlers
- Implement keyboard event handling in page controller
- Support letter keys (a-z), numbers (0-9), and special keys
- Support modifier keys: ctrl, alt, meta, shift
- Support key combinations like ctrl+s, alt+f, etc.
- Add automatic focus management for keyboard-enabled elements
- Handle dynamically added elements via MutationObserver
- Add proper cleanup of keyboard listeners on disconnect
- Update rollup config to output to liveview/static directory
- Compile and minify JavaScript bundles
2026-01-07 13:29:58 +01:00

26 lines
580 B
JavaScript

import { nodeResolve } from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
const production = process.env.BUILD === 'production';
export default {
input: 'main.js',
output: [
{
file: '../liveview/static/liveview/liveview.js',
format: 'iife',
name: 'DjangoLiveView',
sourcemap: !production
},
production && {
file: '../liveview/static/liveview/liveview.min.js',
format: 'iife',
name: 'DjangoLiveView',
plugins: [terser()]
}
].filter(Boolean),
plugins: [
nodeResolve()
]
};