Browse Source

storybook vite works

main
Yanick Champoux 10 months ago
parent
commit
5b7b8336d6
  1. 4
      .storybook/main.js
  2. 2
      package.json

4
.storybook/main.js

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

2
package.json

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

Loading…
Cancel
Save