Fix PUBLIC_URL

This commit is contained in:
Haishan 2023-01-30 22:19:18 +08:00
parent ec556ab25c
commit a24a74e9e1

View file

@ -14,13 +14,14 @@ export default defineConfig(async ({ mode }) => {
} catch (e) { } } catch (e) { }
} }
if (!hash) hash = ''; if (!hash) hash = '';
console.log('commit hash', hash);
return { return {
define: { define: {
__VERSION__: JSON.stringify(pkg.version), __VERSION__: JSON.stringify(pkg.version),
__COMMIT_HASH__: JSON.stringify(hash), __COMMIT_HASH__: JSON.stringify(hash),
'process.env.NODE_ENV': JSON.stringify(mode), 'process.env.NODE_ENV': JSON.stringify(mode),
'process.env.PUBLIC_URL': JSON.stringify('./'), 'process.env.PUBLIC_URL': JSON.stringify(''),
}, },
base: './', base: './',
resolve: { resolve: {