mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 05:20:46 +08:00
refactor: simplify plugin branding
This commit is contained in:
parent
4c5d9722e8
commit
e85dfa6a79
5 changed files with 15 additions and 34 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
||||
import { mkdir, writeFile } from 'node:fs/promises';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
|
@ -8,8 +8,6 @@ const sourceDirectory = dirname(fileURLToPath(import.meta.url));
|
|||
const packageRoot = resolve(sourceDirectory, '../..');
|
||||
const outputPath = resolve(packageRoot, 'lib/client.js');
|
||||
const loaderId = process.env.DSH_IM_CLIENT_ID ?? '@xmanrui/dsh-im';
|
||||
const logoPath = resolve(packageRoot, 'assets/logo-plugin-phone.png');
|
||||
const logoDataUrl = `data:image/png;base64,${(await readFile(logoPath)).toString('base64')}`;
|
||||
|
||||
const result = await build({
|
||||
entryPoints: [resolve(sourceDirectory, 'index.js')],
|
||||
|
|
@ -18,9 +16,6 @@ const result = await build({
|
|||
platform: 'browser',
|
||||
target: ['chrome100'],
|
||||
external: ['react', 'react-dom'],
|
||||
define: {
|
||||
'globalThis.__DSH_IM_LOGO_DATA_URL__': JSON.stringify(logoDataUrl),
|
||||
},
|
||||
write: false,
|
||||
minify: process.env.NODE_ENV === 'production',
|
||||
legalComments: 'none',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue