Vite.js apps with dfx 0.8.1?

Hey has anyone tried running vite.js apps with dfx 0.8.1? my .dfx/local/canisters/accounts/index.js file is now generated with export const canisterId = process.env.ACCOUNTS_CANISTER ID; but vite.js doesn’t use process.env. It uses import.meta.env and the environment variables need to be prefixed with VITE * the lack of process.env is a problem with vite, but I still like working with it and don’t quite want to switch to webpack unless I’ve tried all my options. Any ideas?

2 Likes
1 Like

You can also try this one out GitHub - shalexbas/ic-app-vue-3-ts-template: internet computer vue-3-ts template with dfx >=0.8.0 support + generated ic-agent code + ic-agent-autocompletion + eslint + prettier , make sure to also try out the second branch.

1 Like

Thanks @shalexbas I got it working.
Posting here for future reference

1 Like