In the routing configuration of a Vue.js 2.x app, any statically imported components will be added to the default bundle. Any dynamically imported components will be saved in a separate bundle, e.g.
// routes.js
import Component1 from '@/component1.vue' // added to default bundle
import Component2 from '@/component2.vue' // added to default bundle
const Component3 = () => import('@/component3.vue') // saved in a bundle on its own
const Component4 = () => import('@/component4.vue') // saved in a bundle on its own
If I want to add a JavaScript file (not a Vue component) to the default bundle, I could also import in routes.js, but I then get an ESLint warning/error that I've an unused import.
import myService from '@/services/my-service.js' // eslint-disable-line no-unused-vars
The app in question is built with Vite which uses Rollup to bundle files. Is there a more elegant way to add a .js file to the default bundle, e.g. via the rollupOptions in vite.config.js