Open nilooy opened 2 years ago
also there's no dist
folder generated with preact
Fixed by updated vite.config.js (REF: https://github.com/extend-chrome/rollup-plugin-chrome-extension/issues/255#issuecomment-1073941602)
import { defineConfig } from 'vite'
import preact from '@preact/preset-vite'
import { crx } from 'rollup-plugin-chrome-extension'
import manifest from './manifest.json'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [preact(), crx({ manifest,
contentScripts: {
preambleCode: false
}
})
]
})
But HMR is not working with preact. Does anyone have any suggestion on that?
React and Vue required special handling. I'd need to look into how preact HMR is implemented.
Eventually, this will be something to fix in userland, but we need to get the plugin API stable.
Can this be any use for vite https://github.com/preactjs/prefresh/tree/main/packages/vite ?
Build tool
Vite
Where do you see the problem?
Describe the bug
I have followed the guide from https://dev.to/jacksteamdev/create-a-vite-react-chrome-extension-in-90-seconds-3df7 but i have used
preact
when configuring withvite
and i guess that can be an issue but i would like to know if there's any know solution to this.Reproduction
npm init vite@latest
preact
vite.config.js
// https://vitejs.dev/config/ export default defineConfig({ plugins: [preact(), chromeExtension({ manifest })] })
npm run dev
Logs
System Info
Severity
annoyance