aotds-docks/.storybook/main.js

48 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-03-01 17:42:33 +00:00
const path = require("path");
const preprocess = require("svelte-preprocess");
module.exports = {
2022-03-26 16:41:42 +00:00
core: { builder: "storybook-builder-vite" },
2022-03-01 17:42:33 +00:00
staticDirs: ["../static", "../pictures"],
stories: [
"../src/**/*.stories.mdx",
"../src/**/*.stories.svelte",
"../src/**/stories.svelte",
],
addons: [
"@storybook/addon-essentials",
"@storybook/addon-svelte-csf",
],
framework: "@storybook/svelte",
svelteOptions: {
preprocess: preprocess(),
2022-03-06 22:09:01 +00:00
},
async viteFinal(config, { configType }) {
2022-03-26 16:41:42 +00:00
if(!config.resolve.alias) config.resolve.alias = {};
2022-03-06 22:09:01 +00:00
// customize the Vite config here
config.resolve.alias.$lib = path.resolve(__dirname, "../src/lib/");
config.resolve.alias.$app = path.resolve(__dirname, "../fake/app/");
2022-03-22 21:39:10 +00:00
config.resolve.dedupe = ["@storybook/client-api"];
2022-03-06 22:09:01 +00:00
// return the customized config
return config;
2022-03-01 17:42:33 +00:00
},
webpackFinal: async (config) => {
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve?.alias,
$app: path.resolve("./fake/app"),
"\\$lib": path.resolve(__dirname, "../src/lib/"),
$lib: path.resolve(__dirname, "../src/lib/"),
2022-03-02 00:14:01 +00:00
"\\$app/env": path.resolve(__dirname, "../fake/app/env.js"),
2022-03-01 17:42:33 +00:00
},
},
};
},
};