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

0.10.2 Broke Our Workflow #101

Closed
mrrosoff opened this issue Oct 30, 2022 · 5 comments
Closed

0.10.2 Broke Our Workflow #101

mrrosoff opened this issue Oct 30, 2022 · 5 comments

Comments

@mrrosoff
Copy link

Hi There,

There is no issue template so let me know if this is the right place. This (f28e66bdf1e6c4be28497865acab2e3db12b0e6b) commit broke our workflow for a package.

Can you explain your reasoning for transitioning from dist/electron to dist-electron? This makes development vs production builds bundle to different directories, which confuses the main entrypoint path in package.json. We will not be able to upgrade to v0.10.2 until this is reverted.

Thanks.

@caoxiemeihao
Copy link
Member

Thans for your feedback!
The dist folder will be cleaned by Vite by default, so we have to explicitly set emptyDir: false to avoid this behavior.
I observed that Vite's ssr code is built into dist-ssr, maybe we also need to use dist-electron like ssr would be more ideal.

But, you can set the outDir for your projects.

export default defineConfig({
  plugins: [
    electron({
      entry: 'electron/main.ts',
      vite: {
        build: {
+         outDir: 'dist/electron',
        },
      },
    }),
  ],
})

@mrrosoff
Copy link
Author

Thanks! That makes sense. I guess I would be careful overriding the Vite default behavior like that, although allowing this setting makes sense. Would it be possible to add it to the documentation somewhere as an example? Also I think your commit/changelog has a typo and just says dist/electron -> dist/electron.

@mrrosoff
Copy link
Author

I can also make a PR if that helps, although you seem to be the core contributor, so I don't want to step on any toes.

@caoxiemeihao
Copy link
Member

Looking forward to receiving your PR :)

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

2 participants