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

Missing documentation for using Ziggy from an npm package CDN #292

Closed
bakerkretzmar opened this issue May 8, 2020 · 1 comment · Fixed by #299
Closed

Missing documentation for using Ziggy from an npm package CDN #292

bakerkretzmar opened this issue May 8, 2020 · 1 comment · Fixed by #299
Assignees

Comments

@bakerkretzmar
Copy link
Collaborator

Now that Ziggy is published on npm, it should be possible to use it with something like cdnjs or unkpkg. You'd need to import the generated routes yourself, but as long as you declare those first you should be able to do something like this:

<!-- import/define the Ziggy object up here -->

<script defer src="https://unpkg.com/[email protected]/dist/js/route.min.js"></script>

<script type="text/javascript">
    route('home'); // this should work
</script>
@bakerkretzmar bakerkretzmar self-assigned this May 8, 2020
@bakerkretzmar bakerkretzmar added the in progress We're working on it label May 8, 2020
@ankurk91
Copy link
Contributor

ankurk91 commented May 9, 2020

@bakerkretzmar
Yes, it should work.

route('home');

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

Successfully merging a pull request may close this issue.

2 participants