@storybook/addon-svelte-csf 4.1.5 → 4.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,11 @@ import { extractStories } from '../parser/extract-stories.js';
5
5
  import { loadSvelteConfig } from '../config-loader.js';
6
6
  export async function readStories(fileName) {
7
7
  let code = (await fs.readFile(fileName, 'utf-8')).toString();
8
- const svelteOptions = await loadSvelteConfig();
8
+ const loadedSvelteOptions = await loadSvelteConfig();
9
+ /**
10
+ * loadedSvelteOptions can be {default: {...}, configFile: '...path'}
11
+ */
12
+ const svelteOptions = loadedSvelteOptions?.default ? loadedSvelteOptions.default : loadedSvelteOptions;
9
13
  if (svelteOptions && svelteOptions.preprocess) {
10
14
  code = (await svelte.preprocess(code, svelteOptions.preprocess, { filename: fileName })).code;
11
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-svelte-csf",
3
- "version": "4.1.5",
3
+ "version": "4.1.6",
4
4
  "description": "Allows to write stories in Svelte syntax",
5
5
  "keywords": [
6
6
  "storybook-addons",