mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 13:38:49 +08:00
feat: support debug with blocksuite (#582)
Co-authored-by: Yifeng Wang <doodlewind@toeverything.info>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const { getGitVersion, getCommitHash } = require('./scripts/gitInfo');
|
||||
const { dependencies } = require('./package.json')
|
||||
const { dependencies } = require('./package.json');
|
||||
const path = require('node:path');
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
@@ -13,7 +14,38 @@ const nextConfig = {
|
||||
CI: process.env.CI || null,
|
||||
VERSION: getGitVersion(),
|
||||
COMMIT_HASH: getCommitHash(),
|
||||
EDITOR_VERSION: dependencies['@blocksuite/editor']
|
||||
EDITOR_VERSION: dependencies['@blocksuite/editor'],
|
||||
},
|
||||
transpilePackages: process.env.LOCAL_BLOCK_SUITE
|
||||
? ['@blocksuite/editor', '@blocksuite/blocks', '@blocksuite/store']
|
||||
: [],
|
||||
webpack: config => {
|
||||
if (
|
||||
process.env.LOCAL_BLOCK_SUITE &&
|
||||
path.isAbsolute(process.env.LOCAL_BLOCK_SUITE)
|
||||
) {
|
||||
config.resolve.alias['yjs'] = require.resolve('yjs');
|
||||
config.resolve.extensionAlias = {
|
||||
'.js': ['.js', '.ts', '.tsx'],
|
||||
};
|
||||
const baseDir = process.env.LOCAL_BLOCK_SUITE;
|
||||
config.resolve.alias['@blocksuite/editor'] = path.resolve(
|
||||
baseDir,
|
||||
'packages',
|
||||
'editor'
|
||||
);
|
||||
config.resolve.alias['@blocksuite/blocks'] = path.resolve(
|
||||
baseDir,
|
||||
'packages',
|
||||
'blocks'
|
||||
);
|
||||
config.resolve.alias['@blocksuite/store'] = path.resolve(
|
||||
baseDir,
|
||||
'packages',
|
||||
'store'
|
||||
);
|
||||
}
|
||||
return config;
|
||||
},
|
||||
images: {
|
||||
unoptimized: true,
|
||||
|
||||
Reference in New Issue
Block a user