-
Notifications
You must be signed in to change notification settings - Fork 213
vite-plugin
breaks Vite dev server when build.rollupOptions.input
s are present
#865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same error for me |
Sep 24 2024 - same error, issue still there |
@denis-ismailaj Did you find a workaround for this? I can't really downgrade |
@ngryman Unfortunately, I did not. I ended up just dealing with the additional hassle of doing |
try disabling input when the mode is "development" export default ({ mode }) => {
const isDev = mode === 'development'
const rollupOptionsInput = !isDev ? ['independent.ts'] : []
return {
plugins: [
crx({
manifest: {
manifest_version: 3,
name: 'CRXJS',
version: '1.0.0',
},
}),
],
build: {
rollupOptions: {
input: rollupOptionsInput,
},
},
}
} |
Thanks for contributing to CRXJS! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days. |
Build tool
Vite
Where do you see the problem?
Describe the bug
Original issue context: In a Svelte project I added a typescript file (which was not referenced in the project) to
build.rollupOptions.input
so it was processed and outputted as a separate file with the intent to dynamically import it.This works when doing
npm run build
(vite build
), but when doingnpm run dev
(vite
) Rollup ends up trying to parse it as a javascript file.This only occurs when the
crx
plugin is present.Reproduction
To reproduce you only need an empty dir with these files in the root:
independent.ts
package.json
vite.config.js
Run:
Comment out
crx
plugin invite.config.js
Run:
I should note that the same thing happens with
vite@3
.I also tried overriding the build-related dependency versions of
vite-plugin
to be the latest ones, but that didn't lead to anything.Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: