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

Use in Astro Project #21

Closed
CraigTheNerd opened this issue Jul 15, 2024 · 5 comments · Fixed by #22
Closed

Use in Astro Project #21

CraigTheNerd opened this issue Jul 15, 2024 · 5 comments · Fixed by #22
Assignees
Labels
bug Something isn't working

Comments

@CraigTheNerd
Copy link

CraigTheNerd commented Jul 15, 2024

Would it be possible to use this plugin in an Astro project.

I tried following the Astro docs on how to install Vite plugins but I can't get it working.

Here is my astro.config.mjs

import { defineConfig } from 'astro/config';
import VitePluginBrowserSync from 'vite-plugin-browser-sync'

// https://astro.build/config
export default defineConfig({
    vite: {
        plugins: [
            VitePluginBrowserSync({
                dev: {
                    bs: {
                        ui: {
                            port: 8080
                        },
                        notify: false
                    }
                }
            })
        ]
    }
});

I would appreciate any help, thanks!

@Applelo Applelo self-assigned this Jul 19, 2024
@Applelo Applelo added the bug Something isn't working label Jul 19, 2024
@Applelo
Copy link
Owner

Applelo commented Jul 19, 2024

Hi 👋 It seems the plugin is not working on Astro 😶 I will try to find why 🤔

@CraigTheNerd
Copy link
Author

Thanks so much, would appreciate it if you get it working. Please keep me posted. Thanks!!!

@CraigTheNerd
Copy link
Author

Didn't mean to close the issue, definitely still open and waiting for feedback and solution thanks

@Applelo
Copy link
Owner

Applelo commented Jul 19, 2024

I will publish a new version soon that support AstroJS.

For the small story, Astro doesn't pass on dev env.isPreview so the plugin was not applied. The second problem with Astro, it uses the Vite Dev Server but doesn't use the logger from ViteJS so the plugin cannot hook and print urls information.

@Applelo Applelo mentioned this issue Jul 19, 2024
@Applelo Applelo linked a pull request Jul 19, 2024 that will close this issue
@Applelo
Copy link
Owner

Applelo commented Jul 19, 2024

You can try the last version, feel free to reopen this issue if necessary 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants