Closed pmiguelmartins closed 1 year ago
provide vite
and node
version
After version 1.2.0, in most case, you not need to set injectFileBase, it will be automatically detected from the base of vite config、publicPath of webpack config or publicPath of umi config
import { webUpdateNotice } from '@plugin-web-update-notification/vite'
依然不行啊 ^1.5.2
没找到你的源码, 不知道在哪里改, 假如使用 es module (export import )写的nodejs 项目, 你要自己声明__dirname
import { dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
// or
// expose.js
module.exports = {__dirname};
// use.mjs
import expose from './expose.js';
const {__dirname} = expose;
晚上我修下。你本地 node
版本多少,改完我测试下。
v16.16.0
其实我是有处理 __dirname
的,只是打包时,target 设置错了。
export function get__Dirname() {
if (import.meta?.url)
return dirname(fileURLToPath(import.meta.url))
return __dirname
}
可以安装下最新版本的试试 https://github.com/GreatAuk/plugin-web-update-notification/commit/74466bf88db9bea6ec5c44afd040f3f98be3d2de
@pmiguelmartins sorry, I don't notice that you are a English user, this issue fixed in 1.5.3
.
@pmiguelmartins sorry, I don't notice that you are a English user, this issue fixed in
1.5.3
.
Already try and work just fine
thanks
In Vite Vue 3 width typescript
I'm receiving this error
I try to use injectFileBase but when I'm building always receive this error
How can I solve
Thansk