Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: match backslash-separated preset paths so the addon finds its registration on Windows",
"packageName": "@fluentui/react-storybook-addon-export-to-sandbox",
"email": "array.knight@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export function webpack(config: WebpackFinalConfig, options: WebpackFinalOptions
}

const identity = <T extends unknown>(value: T) => value;
const addonFilePattern = /react-storybook-addon-export-to-sandbox\/[a-z/]+.[jt]s$/;
// Both path separators on purpose: on Windows the registered preset name is an absolute
// path with backslashes (e.g. `...\react-storybook-addon-export-to-sandbox\temp\preset.ts`);
// a forward-slash-only pattern fails to find the registration, silently drops the addon
// options, and the full-source babel plugin then crashes on undefined `importMappings`.
const addonFilePattern = /react-storybook-addon-export-to-sandbox[\\/][a-z\\/]+.[jt]s$/;
const defaultOptions = {
webpackRule: {},
babelLoaderOptionsUpdater: identity,
Expand Down
Loading