Changed package to an ES module
I was getting vue ssr error module not found errors and ultimately ended up updating the package.json to be of "type": "module". This also required updating the import and export statements. The ssr errors have now stopped for me.
Hi, thanks for your contribution! Let me look into this. I also tried making that change but in the end something didn't work properly. live_vue package is consumed by multiple clients:
- Vite configuration
- app.js
- SSR bundle
and they have different requirements about ES modules (JS ecosystem is a fck mess when it comes to that).
I'm closing this PR. After #32 I'm compiling all the files before publishing and they have now a consistent import / export usage.
Also, package.json explicitly says these files should be imported, not required:
"exports": {
"./vitePlugin": {
"import": "./priv/static/vitePlugin.js",
"types": "./priv/static/vitePlugin.d.ts"
},
"./server": {
"import": "./priv/static/server.js",
"types": "./priv/static/server.d.ts"
},
".": {
"import": "./priv/static/index.js",
"types": "./priv/static/index.d.ts"
}
}
Hopefully these should resolve all the errors!