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

Switch from webpack to vite #7

Closed
grctest opened this issue Oct 20, 2023 · 1 comment
Closed

Switch from webpack to vite #7

grctest opened this issue Oct 20, 2023 · 1 comment

Comments

@grctest
Copy link
Collaborator

grctest commented Oct 20, 2023

Is your feature request related to a problem? Please describe.

We're currently using webpack, this requires multiple additional dev dependencies like babel, loaders, and multiple plugins.

Describe the solution you'd like

Vite is an alternative we could consider which would reduce the quantity of dev/peer dependencies we need to maintain whilst also introducing several DX improvements over webpack.

Describe alternatives you've considered

Continue using webpack.

Additional context

https://electron-vite.github.io

https://github.com/alex8088/quick-start/blob/master/packages/create-electron/playground/vue/package.json

@grctest
Copy link
Collaborator Author

grctest commented Jan 5, 2024

Attempting to switch to vite in this branch: https://github.com/beetapp/beeteos/tree/vite

Run into a blocking issue though that's preventing dev/build from running:

[vite:build-import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files.
file: C:/vite-beet/src/components/popups.vue:153:9
151:     return injectChips;
152:   });
153: </script>
              ^
154:
155: <template>
error during build:
RollupError: Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files.
    at error (file:///C:/vite-beet/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
    at Object.error (file:///C:/vite-beet/node_modules/rollup/dist/es/shared/node-entry.js:18457:20)
    at Object.error (file:///C:/vite-beet/node_modules/rollup/dist/es/shared/node-entry.js:17566:42)
    at Object.transform (file:///C:/vite-beet/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:66044:22)

Which is weird, because the dev dependencies show it's installed:

  "devDependencies": {
    "@vitejs/plugin-vue": "^5.0.2",
    "electron": "^28.1.1",
    "electron-builder": "^24.9.1",
    "less": "^4.2.0",
    "sass": "^1.69.7",
    "typescript": "^5.3.3",
    "vite": "^5.0.10",
    "vite-plugin-electron": "^0.28.0-beta.2",
    "vite-plugin-electron-renderer": "^0.14.5",
    "vue": "^3.4.5",
    "vue-tsc": "^1.8.27"
  }

And it's also included in the vite config plugins:

import vue from "@vitejs/plugin-vue";

export default defineConfig({
  plugins: [
    vue(),

Need to figure out why the SFC format and vue files aren't being processed by the plugin..

vitejs/vite-plugin-vue#329

@grctest grctest mentioned this issue Jan 7, 2024
@grctest grctest closed this as completed Feb 23, 2024
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

No branches or pull requests

1 participant