10000 Switch to Vite · Issue #118 · laravelio/paste.laravel.io · GitHub
[go: up one dir, main page]

Skip to content

Switch to Vite #118

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

Closed
driesvints opened this issue Aug 3, 2022 · 2 comments · Fixed by #121
Closed

Switch to Vite #118

driesvints opened this issue Aug 3, 2022 · 2 comments · Fixed by #121

Comments

@driesvints
Copy link
Member

Similar to laravelio/laravel.io#882

@thinkverse
Copy link
Contributor
thinkverse commented Aug 31, 2022

Started work on this and found an issue where highlightjs-line-numbers.js doesn't work with Vite's ES6 modules. This is due to it being restricted to CommonJS (wcoder/highlightjs-line-numbers.js#78).

A potential workaround is using a CDN like Cloudflare and loading it after app.js where the plugin can access hljs on the window like it's designed. Or switching to another open-source free code highlighter like Prism.

Any recommendations on which avenue to pursue?

@thinkverse
Copy link
Contributor

Found a third option I found is to create an intermediate JavaScript file in resources/js that imports highlightjs-line-numbers.js that gets resolved after app.js in its own <script> tag. This has the same effect as using the CDN it's just it uses the npm version instead.

driesvints pushed a commit that referenced this issue Sep 8, 2022
* Move to Vite

* Apply StyleCI fixes manually

* Fix unable to resolve asset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants
0