just typed
meteor create --vue test-vue
cd ./test-vue
meteor build ../ --architecture os.linux.x86_64
I didn’t touch any code. But I got build error.
just typed
meteor create --vue test-vue
cd ./test-vue
meteor build ../ --architecture os.linux.x86_64
I didn’t touch any code. But I got build error.
I worked on a MacBook M2 Air.
Ok, you have an error there. Could you check on that? Do you (the default code) import anything after a constant/variable declaration or lower down in your view/component?
I’m interested to see if this can be resolved. Will soon start converting my app from vue 2 to vue 3. Since the vite integration only got published a while back, it seems possible that perhaps you have uncovered an issue that has gone unnoticed until now. Could you please open an issue about it here: Issues · meteor-vue/vue-meteor-tracker · GitHub
After quite some looking around i finally found the solution…
It’s as simple as not using dynamic imports in the router.js
.
Sent a pull request for the example repository Fix build "terser minification error" by nooitaf · Pull Request #2 · henriquealbert/meteor-vue3 · GitHub
In short change imports/ui/router.js
from …
import { createRouter, createWebHistory } from 'vue-router'
import Home from './Home.vue'
export const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
name: 'home',
component: Home,
},
{
path: '/about',
name: 'about',
component: () => import('./About.vue'),
},
],
})
To…
import { createRouter, createWebHistory } from 'vue-router'
import Home from './Home.vue'
import About from './About.vue'
export const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
name: 'home',
component: Home,
},
{
path: '/about',
name: 'about',
component: About
},
],
})