Can't use vue plugin with vite
See original GitHub issueZiggy version
1.3.5
Laravel version
8.52
Description
Aliasing ziggy
to vendor/tightenco/ziggy/dist/vue
or vendor/tightenco/ziggy/dist
doesn’t allow es module import.
Just posting this in case anyone else has this issue, managed to get it imported using below code. Using the alias didn’t work.
Ziggy call and context
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m.js';
import { Ziggy } from '../js/ziggy.js';
createApp().use(ZiggyVue, Ziggy)
Ziggy configuration
N/A
Route definition
N/A
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Can't install @vitejs/plugin-vue - Laracasts
Hi, I've just installed a fresh version of Laravel 9 and wanted to use Vite and Vue, but when I do @vitejs/plugin-vue I've...
Read more >@vitejs/plugin-vue - npm
Start using @vitejs/plugin-vue in your project by running `npm i ... vite.config.js import vue from '@vitejs/plugin-vue' export default ...
Read more >[plugin-vue] Can't use custom compiler · Issue #6587 · vitejs/vite
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should...
Read more >Adding a plugin to vite - vue.js - Stack Overflow
In reading Vite doc's I see you add plugins via the vite.config.js file instead of using Vue.use() in main.js. So I created one...
Read more >Unable to use vite plugin referenced type in main vuejs app
src/views/Home.vue:5:32 - error TS6305: Output file 'C:/app/vite_plugins/types.d.ts' has not been built from source ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@atymic You need to toss Ziggy to the optimizer too, like so:
Probably worth a note for the docs.
@atymic what if you alias directly to one of the files that uses ES modules?
vendor/tightenco/ziggy/dist/vue.es.js
orvendor/tightenco/ziggy/dist/vue.m.js
?