Skip to content
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

[plugin-vite] allow custom vite outDir #3865

Open
3 tasks done
spiotr12 opened this issue Feb 27, 2025 · 0 comments
Open
3 tasks done

[plugin-vite] allow custom vite outDir #3865

spiotr12 opened this issue Feb 27, 2025 · 0 comments

Comments

@spiotr12
Copy link

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

I try to use vite plugin but I have everything configured to output to ./dist. I'm getting following error:

An unhandled rejection has occurred inside Forge:
Error: Electron Forge is configured to use the Vite plugin. The plugin expects the
"main" entry point in "package.json" to be ".vite/*" (where the plugin outputs
the generated files). Instead, it is "dist/electron/src/main.js"

I've check code and search for this issue. Why we cannot specify custom output dir? Why it is hardcoded

my vite.main.config.ts looks like this:

import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';

// https://vitejs.dev/config
export default defineConfig({
  build: {
    outDir: './dist/electron/src/',
  },
  plugins: [
    viteStaticCopy({
      targets:[
        {
          src: './projects/electron/package.json',
          dest: '../'
        }
      ]
    }),
  ],
});

Proposed solution

Allow for custom baseDir

Alternatives considered

Remove hardcoded code

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant