CRXJS provides extension HTML pages with Vite HMR during development and optimizations in production builds. Extension pages include popups, options pages, and custom pages.
You can open extra pages from your extension code:
background.ts
// Open on installchrome.runtime.onInstalled.addListener((details) => { if (details.reason === 'install') { chrome.tabs.create({ url: 'pages/welcome.html' }) }})// Open from popupchrome.runtime.getURL('pages/onboarding.html')
During development, CRXJS emits placeholder HTML files that redirect to the Vite dev server. This ensures the extension loads correctly while preserving HMR functionality.From the source code (plugin-manifest.ts:461):
// Import CSSimport './popup.css'// Import imagesimport logo from './logo.png'// Import componentsimport { App } from './App'// Use frameworksimport React from 'react'import ReactDOM from 'react-dom/client'ReactDOM.createRoot(document.getElementById('root')!).render( <React.StrictMode> <App /> </React.StrictMode>,)