Repository navigation
Replies: 1 comment
|
Remove the extra import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
})You can keep your namespace import: import * as protobuf from 'protobufjs'
console.log(protobuf.Enum)I reproduced the I also built a separate minimal IIFE with Vite and executed the emitted JavaScript in Node: with the extra plugin, If you need to customize the built-in transform, use |
Uh oh!
There was an error while loading. Please reload this page.
Hello guys, I want use protobuf in javascript, it in:
https://github.com/protobufjs/protobuf.js/
I use it in vue3, the pack tool is vite5.
Test code is:
Vite config is:
It works fine in development mode, but error is appeared when I run
npm run build:All reactions