mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 14:56:59 +08:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
38
blocksuite/playground/scripts/hmr-plugin/index.ts
Normal file
38
blocksuite/playground/scripts/hmr-plugin/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import path from 'node:path';
|
||||
|
||||
import {
|
||||
hmrPlugin as wcHmrPlugin,
|
||||
presets,
|
||||
} from 'vite-plugin-web-components-hmr';
|
||||
|
||||
import { fineTuneHmr } from './fine-tune.js';
|
||||
|
||||
const customLitPath = path.resolve(
|
||||
__dirname,
|
||||
'../../../blocks/src/_legacy/index.js'
|
||||
);
|
||||
|
||||
const include = ['../blocks/src/**/*'];
|
||||
const exclude = ['**/*/node_modules/**/*'];
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export const hmrPlugin = process.env.WC_HMR
|
||||
? [
|
||||
wcHmrPlugin({
|
||||
include,
|
||||
exclude,
|
||||
presets: [presets.lit],
|
||||
decorators: [{ name: 'customElement', import: 'lit/decorators.js' }],
|
||||
baseClasses: [
|
||||
{
|
||||
name: 'ShadowlessElement',
|
||||
import: customLitPath,
|
||||
},
|
||||
],
|
||||
}),
|
||||
fineTuneHmr({
|
||||
include,
|
||||
exclude,
|
||||
}),
|
||||
]
|
||||
: [];
|
||||
Reference in New Issue
Block a user