storybook vite works

main
Yanick Champoux 2022-03-26 12:41:42 -04:00
parent 33ccbaf293
commit 5b7b8336d6
2 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@ const path = require("path");
const preprocess = require("svelte-preprocess"); const preprocess = require("svelte-preprocess");
module.exports = { module.exports = {
// core: { builder: "storybook-builder-vite" }, core: { builder: "storybook-builder-vite" },
staticDirs: ["../static", "../pictures"], staticDirs: ["../static", "../pictures"],
stories: [ stories: [
"../src/**/*.stories.mdx", "../src/**/*.stories.mdx",
@ -18,6 +18,8 @@ module.exports = {
preprocess: preprocess(), preprocess: preprocess(),
}, },
async viteFinal(config, { configType }) { async viteFinal(config, { configType }) {
if(!config.resolve.alias) config.resolve.alias = {};
// customize the Vite config here // customize the Vite config here
config.resolve.alias.$lib = path.resolve(__dirname, "../src/lib/"); config.resolve.alias.$lib = path.resolve(__dirname, "../src/lib/");
config.resolve.alias.$app = path.resolve(__dirname, "../fake/app/"); config.resolve.alias.$app = path.resolve(__dirname, "../fake/app/");

View File

@ -24,7 +24,7 @@
"eslint-plugin-svelte3": "^3.4.1", "eslint-plugin-svelte3": "^3.4.1",
"prettier": "~2.5.1", "prettier": "~2.5.1",
"prettier-plugin-svelte": "^2.6.0", "prettier-plugin-svelte": "^2.6.0",
"storybook-builder-vite": "0.1.17", "storybook-builder-vite": "0.1.21",
"svelte": "^3.46.4", "svelte": "^3.46.4",
"vite": "^2.7.0" "vite": "^2.7.0"
}, },