-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreview.js
36 lines (29 loc) · 929 Bytes
/
preview.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** @type { import('@storybook/vue3').Preview } */
import '../src/assets/styles/main.scss'
import { setup } from '@storybook/vue3';
const components = {
install: (app) => {
const components = import.meta.glob("../src/components/**/*.vue", {
eager: true,
});
Object.entries(components).forEach(([path, definition]) => {
const componentName = path
.split("/")
.pop()
.replace(/\.\w+$/, "");
app.component(componentName, definition.default);
});
},
};
//fontawesome
import { library } from "@fortawesome/fontawesome-svg-core";
import { fas } from "@fortawesome/free-solid-svg-icons";
import { far } from "@fortawesome/free-regular-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
library.add(fas);
library.add(far);
setup((app) => {
app.component("font-awesome-icon", FontAwesomeIcon);
app.use(components)
});
// Rest of the file...