Skip to content

Commit

Permalink
feat!: externalizing styles
Browse files Browse the repository at this point in the history
  • Loading branch information
aversini committed Nov 8, 2023
1 parent 5c70cd6 commit 46029e9
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 22 deletions.
2 changes: 2 additions & 0 deletions packages/documentation/src/modules/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "@versini/ui-components/dist/style.css";

import * as UI from "@versini/ui-components";
import clsx from "clsx";
import { useEffect } from "react";
Expand Down
2 changes: 0 additions & 2 deletions packages/ui-components/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import "./button.css";

import React from "react";

import type { ButtonProps } from "./ButtonTypes";
Expand Down
2 changes: 0 additions & 2 deletions packages/ui-components/src/components/Button/ButtonIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import "./button.css";

import React from "react";

import type { ButtonIconProps } from "./ButtonTypes";
Expand Down
2 changes: 0 additions & 2 deletions packages/ui-components/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import "./footer.css";

import clsx from "clsx";

import type { FooterProps } from "./FooterTypes";
Expand Down
3 changes: 0 additions & 3 deletions packages/ui-components/src/components/Footer/footer.css

This file was deleted.

2 changes: 2 additions & 0 deletions packages/ui-components/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "./index.css";

import { Button } from "./Button/Button";
import { ButtonIcon } from "./Button/ButtonIcon";
import { ButtonLink } from "./Button/ButtonLink";
Expand Down
14 changes: 1 addition & 13 deletions packages/ui-components/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/// <reference types="vitest" />

import { resolve } from "node:path";

import fs from "fs-extra";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import { libInjectCss } from "vite-plugin-lib-inject-css";

const packageJson = fs.readJSONSync("package.json");

Expand Down Expand Up @@ -38,9 +35,8 @@ export default defineConfig({
"react/jsx-runtime",
"tailwindcss",
],

output: {
assetFileNames: "assets/[name][extname]",
assetFileNames: "style[extname]",
entryFileNames: "[name].js",
},
},
Expand All @@ -60,13 +56,5 @@ export default defineConfig({
exclude: ["**/__tests__/**/*"],
rollupTypes: true,
}),
libInjectCss({
entry: {
index: "./src/components/index.ts",
Button: "./src/components/Button/Button.tsx",
ButtonIcon: "./src/components/Button/ButtonIcon.tsx",
Footer: "./src/components/Footer/Footer.tsx",
},
}),
],
});
2 changes: 2 additions & 0 deletions packages/ui-components/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="vitest" />

import { defineConfig, mergeConfig } from "vitest/config";

import viteConfig from "./vite.config";
Expand Down

0 comments on commit 46029e9

Please sign in to comment.