mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-06 03:49:56 +08:00
build: enhance debugging with blocksuite
This commit is contained in:
@@ -4,6 +4,11 @@ const { dependencies } = require('./package.json');
|
|||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const printer = require('./scripts/printer').printer;
|
const printer = require('./scripts/printer').printer;
|
||||||
|
|
||||||
|
const enableDebugLocal = path.isAbsolute(process.env.LOCAL_BLOCK_SUITE ?? '');
|
||||||
|
const EDITOR_VERSION = enableDebugLocal
|
||||||
|
? 'local-version'
|
||||||
|
: dependencies['@blocksuite/editor'];
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
productionBrowserSourceMaps: true,
|
productionBrowserSourceMaps: true,
|
||||||
@@ -16,7 +21,7 @@ const nextConfig = {
|
|||||||
CI: process.env.CI || null,
|
CI: process.env.CI || null,
|
||||||
VERSION: getGitVersion(),
|
VERSION: getGitVersion(),
|
||||||
COMMIT_HASH: getCommitHash(),
|
COMMIT_HASH: getCommitHash(),
|
||||||
EDITOR_VERSION: dependencies['@blocksuite/editor'],
|
EDITOR_VERSION,
|
||||||
},
|
},
|
||||||
webpack: config => {
|
webpack: config => {
|
||||||
config.experiments = { ...config.experiments, topLevelAwait: true };
|
config.experiments = { ...config.experiments, topLevelAwait: true };
|
||||||
@@ -63,11 +68,25 @@ const baseDir = process.env.LOCAL_BLOCK_SUITE ?? '/';
|
|||||||
const withDebugLocal = require('next-debug-local')(
|
const withDebugLocal = require('next-debug-local')(
|
||||||
{
|
{
|
||||||
'@blocksuite/editor': path.resolve(baseDir, 'packages', 'editor'),
|
'@blocksuite/editor': path.resolve(baseDir, 'packages', 'editor'),
|
||||||
|
'@blocksuite/blocks/models': path.resolve(
|
||||||
|
baseDir,
|
||||||
|
'packages',
|
||||||
|
'blocks',
|
||||||
|
'src',
|
||||||
|
'models'
|
||||||
|
),
|
||||||
|
'@blocksuite/blocks/std': path.resolve(
|
||||||
|
baseDir,
|
||||||
|
'packages',
|
||||||
|
'blocks',
|
||||||
|
'src',
|
||||||
|
'std'
|
||||||
|
),
|
||||||
'@blocksuite/blocks': path.resolve(baseDir, 'packages', 'blocks'),
|
'@blocksuite/blocks': path.resolve(baseDir, 'packages', 'blocks'),
|
||||||
'@blocksuite/store': path.resolve(baseDir, 'packages', 'store'),
|
'@blocksuite/store': path.resolve(baseDir, 'packages', 'store'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
enable: path.isAbsolute(process.env.LOCAL_BLOCK_SUITE ?? ''),
|
enable: enableDebugLocal,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user