react-spectrum
346d234f - feat(parcel-resolver-storybook): externalize storybook runtime modules to globals

Commit
104 days ago
feat(parcel-resolver-storybook): externalize storybook runtime modules to globals Match upstream Storybook 10 builders (@storybook/builder-vite, @storybook/builder-webpack5) by externalizing every module key in storybook/internal/preview/globals.js's globalsNameReferenceMap. For each specifier, the resolver returns a synthetic ESM cache file at node_modules/.cache/sb-parcel-externals/<key>.js with shape: const { addons, PreviewWeb, ... } = globalThis.__STORYBOOK_MODULE_*; export { addons, PreviewWeb, ... }; export default globalThis.__STORYBOOK_MODULE_*; The runtime bundle (storybook/internal/preview/runtime) populates these globals via its top-level setup() side effect; once Task 1.2 hoists the runtime import, externalized modules resolve to live bindings on the already-populated globals — eliminating the CJS circular-dep that the node_modules patch currently masks. This task adds the resolver only; preview-entry generator + iframe template alignment follow in Tasks 1.2 and 1.3, after which Task 1.4 removes the patch.
Author
Parents
Loading