@soubiran/vite 0.1.4 → 0.2.0
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.
- package/dist/vite.config.d.mts +1 -1
- package/dist/vite.config.mjs +142 -138
- package/package.json +2 -2
package/dist/vite.config.d.mts
CHANGED
package/dist/vite.config.mjs
CHANGED
|
@@ -786,152 +786,156 @@ function structuredData(id, frontmatter, options) {
|
|
|
786
786
|
|
|
787
787
|
//#endregion
|
|
788
788
|
//#region vite.config.ts
|
|
789
|
-
var vite_config_default = (title, hostname, options, config = {}) =>
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
789
|
+
var vite_config_default = (title, hostname, options, config = {}) => {
|
|
790
|
+
const seo = { person: {
|
|
791
|
+
name: "Estéban Soubiran",
|
|
792
|
+
sameAs: [
|
|
793
|
+
"https://x.com/soubiran_",
|
|
794
|
+
"https://www.linkedin.com/in/esteban25",
|
|
795
|
+
"https://www.twitch.tv/barbapapazes",
|
|
796
|
+
"https://www.youtube.com/@barbapapazes",
|
|
797
|
+
"https://github.com/barbapapazes",
|
|
798
|
+
"https://soubiran.dev",
|
|
799
|
+
"https://esteban-soubiran.site",
|
|
800
|
+
"https://barbapapazes.dev"
|
|
801
|
+
]
|
|
802
|
+
} };
|
|
803
|
+
return mergeConfig(defineConfig({
|
|
804
|
+
plugins: [
|
|
805
|
+
vueRouter({
|
|
806
|
+
extensions: [".vue", ".md"],
|
|
807
|
+
routesFolder: "pages",
|
|
808
|
+
dts: "src/typed-router.d.ts",
|
|
809
|
+
extendRoute(route) {
|
|
810
|
+
const path = route.components.get("default");
|
|
811
|
+
if (!path) return;
|
|
812
|
+
if (path.endsWith(".vue")) route.addToMeta({ frontmatter: { page: options.extractPage(path) } });
|
|
813
|
+
if (path.endsWith(".md")) {
|
|
814
|
+
const { data } = matter(readFileSync(path, "utf-8"));
|
|
815
|
+
route.addToMeta({ frontmatter: data });
|
|
816
|
+
}
|
|
802
817
|
}
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
818
|
+
}),
|
|
819
|
+
vue({ include: [/\.vue$/, /\.md$/] }),
|
|
820
|
+
ui({
|
|
821
|
+
autoImport: {
|
|
822
|
+
dts: "src/auto-imports.d.ts",
|
|
823
|
+
dirs: ["src/composables"],
|
|
824
|
+
imports: [
|
|
825
|
+
"vue",
|
|
826
|
+
"vue-router",
|
|
827
|
+
"@vueuse/core",
|
|
828
|
+
unheadVueComposablesImports,
|
|
829
|
+
{
|
|
830
|
+
from: "tailwind-variants",
|
|
831
|
+
imports: ["tv"]
|
|
832
|
+
},
|
|
833
|
+
soubiranComposablesImports
|
|
834
|
+
]
|
|
835
|
+
},
|
|
836
|
+
components: {
|
|
837
|
+
include: [
|
|
838
|
+
/\.vue$/,
|
|
839
|
+
/\.vue\?vue/,
|
|
840
|
+
/\.md$/
|
|
841
|
+
],
|
|
842
|
+
dts: "src/components.d.ts",
|
|
843
|
+
resolvers: [soubiranResolver()]
|
|
844
|
+
},
|
|
845
|
+
ui: { colors: { neutral: "neutral" } }
|
|
846
|
+
}),
|
|
847
|
+
markdown({
|
|
848
|
+
headEnabled: true,
|
|
849
|
+
wrapperClasses: [
|
|
850
|
+
"slide-enter-content",
|
|
851
|
+
"max-w-none",
|
|
852
|
+
"prose prose-neutral dark:prose-invert",
|
|
853
|
+
"prose-headings:text-default prose-h2:text-[1.125em] prose-h2:mb-[0.5em] prose-h3:text-[1em]",
|
|
854
|
+
"prose-p:my-[1em] dark:prose-p:text-muted",
|
|
855
|
+
"dark:prose-ul:text-muted dark:prose-ol:text-muted",
|
|
856
|
+
"dark:prose-strong:text-default",
|
|
857
|
+
"dark:prose-a:text-muted prose-a:font-semibold prose-a:no-underline prose-a:border-b prose-a:border-muted prose-a:transition-colors prose-a:duration-300 prose-a:ease-out prose-a:hover:border-[var(--ui-text-dimmed)]",
|
|
858
|
+
"prose-hr:max-w-1/2 prose-hr:mx-auto prose-hr:my-[2em]",
|
|
859
|
+
"prose-figure:bg-neutral-100 dark:prose-figure:bg-neutral-800 prose-figure:rounded-lg",
|
|
860
|
+
"prose-img:rounded-lg prose-img:border prose-img:border-accented prose-img:shadow-md",
|
|
861
|
+
"prose-video:rounded-lg prose-video:border prose-video:border-accented prose-video:shadow-md",
|
|
862
|
+
"prose-figcaption:text-center prose-figcaption:py-1 prose-figcaption:m-0",
|
|
863
|
+
"[&_:first-child]:mt-0 [&_:last-child]:mb-0"
|
|
827
864
|
],
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
name:
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
head: defaults(frontmatter, frontmatterOptions),
|
|
876
|
-
frontmatter
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
}),
|
|
880
|
-
fonts({ google: { families: [
|
|
881
|
-
{
|
|
882
|
-
name: "DM Sans",
|
|
883
|
-
styles: "ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000"
|
|
884
|
-
},
|
|
865
|
+
transforms: options.markdown?.transforms ?? {},
|
|
866
|
+
wrapperComponent: options.markdown?.wrapperComponent,
|
|
867
|
+
async markdownItSetup(md) {
|
|
868
|
+
githubAlerts(md);
|
|
869
|
+
implicitFiguresRule(md);
|
|
870
|
+
linkAttributesRule(md);
|
|
871
|
+
tableOfContentsRule(md);
|
|
872
|
+
customLink(md, hostname);
|
|
873
|
+
customImage(md, hostname);
|
|
874
|
+
await shikiHighlight(md);
|
|
875
|
+
},
|
|
876
|
+
frontmatterPreprocess(frontmatter, frontmatterOptions, id, defaults) {
|
|
877
|
+
createAssert(options.seo.assert?.rules)(id, frontmatter);
|
|
878
|
+
og(id, frontmatter, hostname);
|
|
879
|
+
canonical(id, frontmatter, hostname);
|
|
880
|
+
structuredData(id, frontmatter, {
|
|
881
|
+
name: title,
|
|
882
|
+
hostname,
|
|
883
|
+
person: options.seo.person ?? seo.person,
|
|
884
|
+
extractPage: options.extractPage,
|
|
885
|
+
getPageConfig: options.seo.structuredData?.pageConfig
|
|
886
|
+
});
|
|
887
|
+
frontmatter.page = options.extractPage(id);
|
|
888
|
+
return {
|
|
889
|
+
head: defaults(frontmatter, frontmatterOptions),
|
|
890
|
+
frontmatter
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
}),
|
|
894
|
+
fonts({ google: { families: [
|
|
895
|
+
{
|
|
896
|
+
name: "DM Sans",
|
|
897
|
+
styles: "ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000"
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
name: "DM Mono",
|
|
901
|
+
styles: "ital,wght@0,300;0,400;0,500;1,300;1,400;1,500"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
name: "Sofia Sans",
|
|
905
|
+
styles: "ital,wght@0,1..1000;1,1..1000"
|
|
906
|
+
}
|
|
907
|
+
] } }),
|
|
908
|
+
icons({ autoInstall: true }),
|
|
909
|
+
apiPlugin(options.apiCategories),
|
|
910
|
+
markdownPlugin(),
|
|
911
|
+
metaPlugin(hostname),
|
|
885
912
|
{
|
|
886
|
-
name: "
|
|
887
|
-
|
|
913
|
+
name: "await",
|
|
914
|
+
async closeBundle() {
|
|
915
|
+
await resolveAll();
|
|
916
|
+
}
|
|
888
917
|
},
|
|
889
918
|
{
|
|
890
|
-
name: "
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
icons({ autoInstall: true }),
|
|
895
|
-
apiPlugin(options.apiCategories),
|
|
896
|
-
markdownPlugin(),
|
|
897
|
-
metaPlugin(hostname),
|
|
898
|
-
{
|
|
899
|
-
name: "await",
|
|
900
|
-
async closeBundle() {
|
|
901
|
-
await resolveAll();
|
|
902
|
-
}
|
|
903
|
-
},
|
|
904
|
-
{
|
|
905
|
-
name: "extract-config",
|
|
906
|
-
configResolved(resolvedConfig) {
|
|
907
|
-
Object.assign(config, resolvedConfig);
|
|
919
|
+
name: "extract-config",
|
|
920
|
+
configResolved(resolvedConfig) {
|
|
921
|
+
Object.assign(config, resolvedConfig);
|
|
922
|
+
}
|
|
908
923
|
}
|
|
909
|
-
}
|
|
910
|
-
],
|
|
911
|
-
optimizeDeps: {
|
|
912
|
-
include: [
|
|
913
|
-
"vue",
|
|
914
|
-
"ofetch",
|
|
915
|
-
"reka-ui",
|
|
916
|
-
"vue-router",
|
|
917
|
-
"@unhead/vue",
|
|
918
|
-
"partysocket",
|
|
919
|
-
"@iconify/vue"
|
|
920
924
|
],
|
|
921
|
-
exclude: ["@soubiran/ui"]
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
925
|
+
optimizeDeps: { exclude: ["@soubiran/ui"] },
|
|
926
|
+
resolve: { alias: { "@": resolve("./src") } },
|
|
927
|
+
ssgOptions: {
|
|
928
|
+
formatting: "minify",
|
|
929
|
+
onPageRendered(route, renderedHTML) {
|
|
930
|
+
routes.add(route);
|
|
931
|
+
return renderedHTML;
|
|
932
|
+
},
|
|
933
|
+
onFinished() {
|
|
934
|
+
sitemap(config, hostname, Array.from(routes));
|
|
935
|
+
}
|
|
932
936
|
}
|
|
933
|
-
}
|
|
934
|
-
}
|
|
937
|
+
}), config);
|
|
938
|
+
};
|
|
935
939
|
|
|
936
940
|
//#endregion
|
|
937
941
|
export { vite_config_default as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soubiran/vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"author": "Estéban Soubiran <esteban@soubiran.dev>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/Barbapapazes",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"vite": "npm:rolldown-vite@7.1.20",
|
|
59
59
|
"vite-ssg": "^28.2.2",
|
|
60
60
|
"vue-router": "^4.6.3",
|
|
61
|
-
"@soubiran/ui": "0.
|
|
61
|
+
"@soubiran/ui": "0.2.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"tsdown": "^0.18.3"
|