fix(storybook): manager.tsx imports relatively (esbuild manager has no aliases)
The prior change aliased manager.tsx to @core, but Storybook's manager bundle (esbuild) doesn't resolve aliases — only the preview/Vite bundle does — so the storybook build failed. Revert manager.tsx to a relative import and scope a one-file no-restricted-imports exemption to .storybook/manager.tsx (the only file that genuinely can't use an alias). preview.tsx keeps @public (Vite-built). Verified: eslint clean + storybook build succeeds.
This commit is contained in:
@@ -11,7 +11,7 @@ import { IconButton, WithTooltip } from "storybook/internal/components";
|
||||
import {
|
||||
THEME_ACCENT_PRESETS as PRESETS,
|
||||
DEFAULT_ACCENT_COLOR,
|
||||
} from "@core/constants/theme";
|
||||
} from "../editor/src/core/constants/theme";
|
||||
|
||||
function AccentPicker() {
|
||||
const [globals, updateGlobals] = useGlobals();
|
||||
|
||||
@@ -324,4 +324,13 @@ export default defineConfig(
|
||||
},
|
||||
},
|
||||
},
|
||||
// Storybook's MANAGER is bundled by esbuild with no alias resolution (only the
|
||||
// preview/Vite bundle resolves @app/@core/etc). manager.tsx must therefore
|
||||
// import editor code relatively — an alias would fail the manager build.
|
||||
{
|
||||
files: [".storybook/manager.tsx"],
|
||||
rules: {
|
||||
"no-restricted-imports": "off",
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user