You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
E:\work\AWB-Tools\node_modules\unplugin-vue-components\dist\chunk-T7EPVSRW.js:107
var _require = _module.createRequire.call(void 0, import.meta.url);
^^^^
SyntaxError: Cannot use 'import.meta' outside a module
如果在package.json中添加type: "module" 能够解决问题,但是又会报electron not function
// vite.config.jsimport{rmSync}from'fs'importpathfrom'path'import{typePlugin,typeUserConfig,defineConfig,}from'vite'importvuefrom'@vitejs/plugin-vue'importelectronfrom'vite-plugin-electron'importpkgfrom'./package.json'importAutoImportfrom'unplugin-auto-import/vite'importComponentsfrom'unplugin-vue-components/vite'import{ElementPlusResolver}from'unplugin-vue-components/resolvers'rmSync('dist',{recursive: true,force: true})// v14.14.0// https://vitejs.dev/config/exportdefaultdefineConfig({plugins: [vue(),electron({main: {entry: 'electron/main/index.ts',vite: withDebug({build: {outDir: 'dist/electron/main',},}),},preload: {input: {// You can configure multiple preload hereindex: path.join(__dirname,'electron/preload/index.ts'),},vite: {build: {// For Debugsourcemap: 'inline',outDir: 'dist/electron/preload',},},},// Enables use of Node.js API in the Renderer-processrenderer: {},}),renderBuiltUrl(),AutoImport({resolvers: [ElementPlusResolver()],}),Components({resolvers: [ElementPlusResolver()],}),],server: {host: pkg.env.VITE_DEV_SERVER_HOST,port: pkg.env.VITE_DEV_SERVER_PORT,},})
The text was updated successfully, but these errors were encountered:
错误信息
如果在
package.json
中添加type: "module"
能够解决问题,但是又会报electron not function
The text was updated successfully, but these errors were encountered: